Python Forum

Full Version: How to plot 2 graphs in one figure?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The below code returns 2 seperate graphs, how can I combine them in one figure?
sns.set()
sns.set_context("notebook")
sns.set_style("darkgrid", {"axes.facecolor":"0.9",'font.family':['Roboto']})

pltsize = (10,7)

yrlsum.plot(x='year', y='TAVG', kind='bar', legend=False, figsize=pltsize,
        color=(yrlsum['TAVG'] > 0).map({True:'darkorange', False:'royalblue'}))

yrlsum['MA'] = yrlsum['TAVG'].rolling(window=10).mean()

yrlsum.plot(x='year', y='MA', kind='line', legend=False, figsize=pltsize,
        color='black', lw=1)

plt.show()