I am trying to plot a pandas dataframe (result_m) using the pandas plotting function, but when I try to save the figure using savefig but it returns a blank pdf. It plots fine in the notebook window. Not sure what I'm doing wrong
fig = plt.figure()
ax = result_m.plot( kind='line', figsize=(20, 10),fontsize=15)
ax.set_title('Harkins Slough Diversions',fontsize= 20)
ax.set_xlabel( "Date",fontsize=18)
ax.set_ylabel("cubic meters",fontsize=18)
plt.legend(fontsize=15)
fig.savefig(os.path.join(outPath4,'plot_fig.pdf'))