Aug-04-2020, 04:24 AM
I am attempting to graph and save temperature and humidity daily data here, which appears to be working fine. Though a extra graph pops up before the one with the data on it, and when I attempt to save using fig.savefig() function it only saves the blank graph. Any idea why the blank graph is popping up? Code and images posted below.
fig,ax = plt.subplots() ax = data_fr.plot(x='Time',y='Temp',color='r',figsize = (10,5)) ax2 = data_fr.plot(x='Time',y='RH',secondary_y=True,color='g',ax=ax,figsize = (10,5)) plt.title('Temperature and RH Daily Graph') ax.set_ylabel('C') ax2.set_ylabel('%') plt.tight_layout() name = str(file[:-9])+ ' T-RH Graph.png' fig.savefig(name, dpi=fig.dpi)Image of the two graphs here: https://github.com/WxExplorer/Weather_St...0Error.png