2024-10-03 04:37:36 发布
网友
我有这张纸条在同一页上绘制7系列。我想将页面方向设置为纵向。如下图所示,我尝试了:
f.savefig(sta+'.pdf', orientation='portrait', format='pdf')
但什么也没发生!在
你有什么建议吗?在
提前感谢:-)
我想你是想改变图形大小,而不是与页面布局有关。orientationkwarg to savefig实际上只适用于PS和EPS后端。对于PDF,页面大小被定义为等于图形大小,因此它没有任何效果。在
orientation
savefig
作为当前结果的一个简单示例:
import matplotlib.pyplot as plt fig, ax = plt.subplots(nrows=7, sharex=True, sharey=False) fig.subplots_adjust(hspace=0.5) plt.show()
要更改图形的大小,请使用figsizekwarg:
figsize
我想你是想改变图形大小,而不是与页面布局有关。
orientation
kwarg tosavefig
实际上只适用于PS和EPS后端。对于PDF,页面大小被定义为等于图形大小,因此它没有任何效果。在作为当前结果的一个简单示例:
要更改图形的大小,请使用
^{pr2}$figsize
kwarg:相关问题 更多 >
编程相关推荐