【问题标题】:Matplotlib 2 stacked subplots, unable to set size of BOTH ytick labelsMatplotlib 2 堆叠子图,无法设置两个 ytick 标签的大小
【发布时间】:2020-01-10 16:57:52
【问题描述】:

我的代码:

import matplotlib.pyplot as plt
fig, axs = plt.subplots(2, sharey=False)
axs[0].plt(stuff)
axs[1].plt(stuff)

我试过了:

plt.yticks(fontsize=15)

plt.tick_params(axis='both', which='major', labelsize=15)

它们都改变了下图中 ytick 标签的大小,但上图保持不变。我一直无法抓住上面的子图 ytick 标签句柄。

【问题讨论】:

  • ax[0].tick_params

标签: matplotlib subplot


【解决方案1】:

感谢@ImportanceOfBeingErnest!

axs[0].tickparams()

这只是抓住了上部子图的句柄。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-11
    • 2019-11-14
    • 2017-05-22
    • 2022-10-13
    • 1970-01-01
    • 1970-01-01
    • 2019-04-30
    • 2020-12-03
    相关资源
    最近更新 更多