In following subplot I have to change the first plot into a bar plot. But using plt.bar rather than plt.plot gives a white plot !

amirrezaheidarysbu at gmail.com amirrezaheidarysbu at gmail.com
Wed Aug 14 15:18:51 EDT 2019


plt.Figure()


plt.subplots_adjust(top=0.945, bottom=0.05, left=0.04, right=0.985, hspace=0.67, wspace=0.345)

plt.subplot(6,1,1)
plt.plot(Date,Energy, "r")
plt.title("Hourly hot water energy use")
plt.ylabel("kWh")
plt.margins(x=0)


plt.subplot(6,1,2)
plt.plot(Date,Tin)
plt.title("Indoor air temperature")
plt.ylabel("Celsius")
plt.margins(x=0)

plt.subplot(6,1,3)
plt.plot(Date,RHin, "g")
plt.title("Indoor air relative humidity")
plt.ylabel("%")
plt.margins(x=0)

plt.subplot(6,1,4)
plt.plot(Date,Tamb, "darkblue")
plt.title("Ambient air temperature")
plt.ylabel("Celsius")
plt.margins(x=0)

plt.subplot(6,1,5)
plt.plot(Date,Insol, "gold")
plt.title("Solar insolation")
plt.ylabel("$W/m^2$")
plt.margins(x=0)

plt.subplot(6,1,6)
plt.plot(Date,Wind, "darkslategrey")
plt.title("Wind speed")
plt.ylabel("$m/s$")
plt.margins(x=0)


plt.show()



More information about the Python-list mailing list