Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove repeated axes labels in a Seaborn facetgrid?

I'm trying to remove the repeated axis x labels of 'time' except for the bottom four panels

what should I do?

grid = sns.FacetGrid(df_va1, col = 'Subject', hue = 'Subject', palette = 'GnBu_d',
                   col_wrap = 4, height = 1.5, aspect= .9)
grid.map(plt.plot, 'TimePoint', 'values', marker = 'o')
grid.set(xticks = [0,3,6,12], yticks = [0, 0.5, 1], xlim = (-0.5,12.5),
        xlabel = 'time', ylabel = 'values')
grid.fig.tight_layout(w_pad=1)

Here is the current plot enter image description here

like image 861
Sam Min Avatar asked Sep 02 '25 10:09

Sam Min


1 Answers

I think you should use

grid.set_axis_labels("time", "values")

and remove your xlabel and ylabel options.

like image 73
david Avatar answered Sep 04 '25 23:09

david