【问题标题】:axes labels and ticks in multiplots多图中的轴标签和刻度
【发布时间】:2013-06-29 16:25:36
【问题描述】:

我不明白为什么我不能在两个图中都显示 x 和 y 轴。我想要主图和子图中的数字和刻度。请在下面找到我使用的代码。

# Main Plot  
plt.axes([.1, .1, .8, .8])
plt.xticks(())
plt.yticks(())
plt.xlabel("Period")
plt.ylabel("Chi")
plt.minorticks_on()
plt.plot(period, chi, 'bo', markersize = 0.5)
# Subplot 
plt.axes([.5, .2, .3, .3])
plt.xticks(())
plt.yticks(())
plt.xlim(3.27, 3.3)
plt.ylim(2,4)
plt.plot(period, chi, 'bo', markersize = 0.5)
plt.savefig("test_fig.jpg", dpi=200)

【问题讨论】:

    标签: python matplotlib subplot


    【解决方案1】:

    当你这样做时:

    plt.xticks(())
    plt.yticks(())
    

    您正在通过将刻度设置为空序列来删除它们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-14
      • 1970-01-01
      • 1970-01-01
      • 2012-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-22
      相关资源
      最近更新 更多