To remove yaxis tag labels, you can use the following code:
The libs:
import seaborn as sns sns.set_style('ticks')
Adjusted Code:
tips = sns.load_dataset("tips") g = sns.FacetGrid(tips, col = 'time') g.despine(offset=10) g = g.map(plt.hist, "tip") # IMPORTANT: I assume that you use colwrap=None in FacetGrid constructor # loop over the non-left axes: for ax in g.axes[:, 1:].flat: # get the yticklabels from the axis and set visibility to False for label in ax.get_yticklabels(): label.set_visible(False) ax.yaxis.offsetText.set_visible(False)

A bit more general, the image now has a 2x2 FacetGrid, you want to interrupt with an offset, but x and yticklabels are returning:

Delete them all with this code:
tips = sns.load_dataset("tips") g = sns.FacetGrid(tips, col = 'time', row='sex') g.despine(offset=10) g = g.map(plt.hist, "tip") # IMPORTANT: I assume that you use colwrap=None in FacetGrid constructor # loop over the non-left axes: for ax in g.axes[:, 1:].flat: # get the yticklabels from the axis and set visibility to False for label in ax.get_yticklabels(): label.set_visible(False) ax.yaxis.offsetText.set_visible(False) # loop over the top axes: for ax in g.axes[:-1, :].flat: # get the xticklabels from the axis and set visibility to False for label in ax.get_xticklabels(): label.set_visible(False) ax.xaxis.offsetText.set_visible(False)

UPDATE:
for completeness, mwaskom ( ref to github issue ) gave an explanation of why this problem occurs:
So this is because matplotlib calls the .reset_ticks () axis inside, moving the spine. Otherwise, the spine moves, but the tics remain in one place. It is not configurable in matplotlib and even if it is, I don’t know if there is a public API for moving individual ticks. Unfortunately, I think that you will have to remove the tick marks yourself after correcting the spikes.
source share