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 !

2019-08-14 Thread amirrezaheidarysbu
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()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to plot a data including date and time?

2019-08-14 Thread amirrezaheidarysbu
On Tuesday, August 13, 2019 at 11:47:28 PM UTC+2, amirrezah...@gmail.com wrote:
> I have a .csv file, in first column I have date and hour, and in the second 
> column I have energy use data. How can I make a bar chart with Date and time 
> as the x axis and the energy use as the Y axis?
> 
> Thanks

Thank you for your guidance. I am already using matplotlib but I do not know 
how to import a column of date and time and to use it properly as the x axis. 
can you tell me the code?


Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


How to plot a data including date and time?

2019-08-13 Thread amirrezaheidarysbu
I have a .csv file, in first column I have date and hour, and in the second 
column I have energy use data. How can I make a bar chart with Date and time as 
the x axis and the energy use as the Y axis?

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list