Created
January 27, 2020 11:31
-
-
Save pierdom/eb7723f96d2042765b776313260bf7d0 to your computer and use it in GitHub Desktop.
[Shift xaxis labels by 0.5 in matplotlib/seaborn] #python #visualization #datascience #matplotlib
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
mybins = [0, 1, 2, 3, 4, 5] | |
ax = sns.distplot(my_df.my_col, bins=mybins) | |
_ = ax.xaxis.set(ticks=np.arange(0.5, len(mybins)), ticklabels=mybins) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment