Skip to content

Instantly share code, notes, and snippets.

@pierdom
Created January 27, 2020 11:31
Show Gist options
  • Save pierdom/eb7723f96d2042765b776313260bf7d0 to your computer and use it in GitHub Desktop.
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
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