Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 12, 2020 17:47
Show Gist options
  • Save aniruddha27/7a7703e556191b560303e163cc0353a9 to your computer and use it in GitHub Desktop.
Save aniruddha27/7a7703e556191b560303e163cc0353a9 to your computer and use it in GitHub Desktop.
#subplots returns a Figure and an Axes object
fig,ax=plt.subplots(nrows=1,ncols=2,figsize=(20,5))
#manipulating the first Axes
ax[0].plot(week,week_order)
ax[0].set_xlabel('Week')
ax[0].set_ylabel('Revenue')
ax[0].set_title('Weekly income')
#manipulating the second Axes
ax[1].plot(month,month_order)
ax[1].set_xlabel('Month')
ax[1].set_ylabel('Revenue')
ax[1].set_title('Monthly income')
#save and display the plot
plt.savefig('C:\\Users\\Dell\\Desktop\\AV Plotting images\\matplotlib_plotting_11.png',dpi=300,bbox_inches='tight')
plt.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment