trying to remove the yaxis values.
d = pd.DataFrame({'row':['a']*9 + ['b']*9 + ['c']*9,
'col': ['fft','krn','bycp']*9,
'val':np.random.randn(27)})
print 'data', d
Tried to grab figure not work.
#f, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
f,ax = plt.subplots()
r= d['row'].unique()
(c1, c2, c3, c4, c5) = sns.color_palette("husl", 6)[:5]
g = sns.FacetGrid(d, col='col', row='row',size=.7, aspect=5, palette="husl",margin_titles=True)
g.map(sns.rugplot,'val',height=.12)
print sns.axes_style()
despine does not remove the values
sns.despine(left='False')
g.fig.subplots_adjust(wspace=.1, hspace=.02);
g.set_axis_labels(['a','b','c'], 'values');
ax = plt.gcf().axes
ax.axes.get_yaxis().set_visible(False)
ax.set_visible(False)
plt.show()
plt.gcf().axes
give AttributeError: 'list' object has no attribute 'axes'
get_yaxis()
does nothing.
How to remove yaxis values from FacetGrid in seaborn?
Try calling g.set(yticks=[])
after you plot. This just loops through the axes and calls ax.set_yticks([])
on each of them.
This will also turn off the ticks/grid lines, which I assume you want for this plot, but if you just want to turn the labels off you can do g.set(yticklabels=[])
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With