Repeating x axis labels for all facets using FacetGrid in seaborn

前端 未结 2 527
栀梦
栀梦 2020-12-16 17:13

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

相关标签:
2条回答
  • 2020-12-16 18:04

    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)
    
    0 讨论(0)
  • 2020-12-16 18:15

    Just add the following lines after your def label(): function. Although the plot doesn't look that good with the modification you want.

    for ax in g.axes.flat:
        _ = plt.setp(ax.get_xticklabels(), visible=True)
    

    Output

    0 讨论(0)
提交回复
热议问题