在 seaborn 中使用 FacetGrid 为所有方面重复 x 轴标签 [英] Repeating x axis labels for all facets using FacetGrid in seaborn

查看:52
本文介绍了在 seaborn 中使用 FacetGrid 为所有方面重复 x 轴标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

解决方案

Bazingaa的答案适用于matplotlib版本2.0.2.对于较新版本的 matplotlib,使用 ax.tick_params() 并设置 labelbottom=True 似乎有效:

for ax in g.axes.flatten():ax.tick_params(labelbottom = True) 

I am working with the FacetGrid example presented here that results in the plot below. 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.

For this example, the values 62, ..., 76 should be repeated for each of the A-J facets.

解决方案

The answer by Bazingaa works for matplotlib version 2.0.2. For newer versions of matplotlib, using ax.tick_params() and setting labelbottom=True seems to work:

for ax in g.axes.flatten():
    ax.tick_params(labelbottom=True)

这篇关于在 seaborn 中使用 FacetGrid 为所有方面重复 x 轴标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆