只需将以下kwarg添加到您的set_ylabel调用中:
ax.set_ylabel("RHS",rotation=-90,labelpad=15)
给出预期的输出:
如果要在设置标签后修改标签,也可以执行以下操作:
yl = ax.set_ylabel("RHS")
ax.yaxis.set_label_position("right")
yl.set_rotation(50)
# do some other stuff
那么别忘了打电话plt.draw()
使它生效。您可能想看看matplotlib文本实例属性。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句