Created
September 7, 2020 16:00
-
-
Save tanpengshi/f246c8db672bd1be458d0e933585cc79 to your computer and use it in GitHub Desktop.
Creating Barplot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plt.figure(figsize=[8,5]) | |
ax = sns.barplot(data=group_station.head(10).reset_index(),x='ENTRY_EXIT',y='STATION',palette='rainbow') | |
plt.xlabel('Total Traffic',weight='bold',fontsize=15) | |
plt.ylabel('Top 10 Stations',weight='bold',fontsize=15) | |
plt.xticks(range(0,400001,50000),[str(int(i/1000))+'k' for i in range(0,400001,50000)]) | |
plt.title('Busiest MTA Stations from 22/8 to 28/8', weight='bold',fontsize='15') | |
for p in ax.patches: | |
ax.annotate(str(int(p.get_width()/1000))+'k', (p.get_width(), p.get_y()+0.5)) | |
sns.despine() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment