[英]Repeating x axis labels for all facets using FacetGrid in seaborn
I am working with the FacetGrid
example presented here that results in the plot below.我正在使用此处介绍的FacetGrid
示例,结果如下图。 In my data set, there is quite a lot of plots, and it would be convenient to have the x
axis labels repeated for each facet, not only at the bottom.在我的数据集中,有相当多的图,并且为每个面重复x
轴标签会很方便,而不仅仅是在底部。
For this example, the values 62, ..., 76
should be repeated for each of the AJ
facets.对于此示例,应为每个AJ
面重复值62, ..., 76
。
The answer by Bazingaa works for matplotlib version 2.0.2. Bazingaa 的答案适用于 matplotlib 2.0.2 版。 For newer versions of matplotlib, using ax.tick_params()
and setting labelbottom=True
seems to work:对于较新版本的 matplotlib,使用ax.tick_params()
并设置labelbottom=True
似乎有效:
for ax in g.axes.flatten():
ax.tick_params(labelbottom=True)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.