Skip to content

Instantly share code, notes, and snippets.

Created March 12, 2020 17:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aniruddha27/bf7cadb77ee0eedc529621b44270ff1a to your computer and use it in GitHub Desktop.
center_type_name = ['TYPE_A','TYPE_B','TYPE_C']
#relation between op area and number of orders
#relation between center type and op area
c_type = {}
for i in center_type_name:
c_type[i] = df[df['center_type']==i].op_area
#relation between center type and num of orders
fig,ax = plt.subplots(nrows=3,ncols=1,figsize=(8,12))
#scatter plots
ax[0].set_xlabel('Operation area')
ax[0].set_ylabel('Number of orders')
ax[0].set_title('Does operation area affect num of orders?')
ax[0].annotate('optimum operation area of 4 km^2',xy=(4.2,1.1*10**7),xytext=(7,1.1*10**7),arrowprops=dict(facecolor='black', shrink=0.05),fontsize=12)
ax[1].boxplot([x for x in c_type.values()], labels=[x for x in c_type.keys()])
ax[1].set_xlabel('Center type')
ax[1].set_ylabel('Operation area')
ax[1].set_title('Which center type had the optimum operation area?')
#bar graph
ax[2].set_xlabel('Center type')
ax[2].set_ylabel('Number of orders')
ax[2].set_title('Orders per center type')
#show figure
plt.savefig('C:\\Users\\Dell\\Desktop\\AV Plotting images\\matplotlib_plotting_12.png',dpi=300,bbox_inches='tight');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment