Skip to content

Instantly share code, notes, and snippets.

@tanpengshi
Last active September 7, 2020 15:52
Show Gist options
  • Save tanpengshi/fffc03612403f70835c871467880f31d to your computer and use it in GitHub Desktop.
Save tanpengshi/fffc03612403f70835c871467880f31d to your computer and use it in GitHub Desktop.
Creating Histogram
group_station = df.groupby('STATION')['ENTRY_EXIT'].sum().sort_values(ascending=False)
fig1 = plt.figure(figsize=[8,6])
ax1 = sns.distplot(group_station,bins=50,kde=False)
plt.xlim([0,410000])
plt.ylabel('No. of Stations',fontsize=15, weight='bold')
plt.xlabel('Total Traffic', fontsize=15, weight='bold')
ax1.annotate('Top 10 Stations', xy=(0.73, 0.08), xytext=(0.73, 0.12), xycoords='axes fraction',
fontsize=12, ha='center', va='bottom',
arrowprops=dict(arrowstyle='-[, widthB=9.0, lengthB=1', lw=1.0),color='blue')
plt.title('Distribution of Traffic Across Stations',fontsize=15,weight='bold')
sns.despine()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment