首页 > 编程知识 正文

python画布尺寸,Python如何创建画布

时间:2023-05-05 14:52:38 阅读:11508 作者:4109

python matplotlib在一张画布上绘制多个图- fig.add _ subplot (importmatplotlib.pyplotaspltfig=PLT.figure ) fig size=(10 ) 2,1 ) #2行2列的索引为1ax1.imshow(NP.random.rand ) ) 5, 5 )、cmap=PLT.cm.blues(#x轴和y轴刻度ax1.set_xticks ) ax1.set_yticks ) #x轴和y轴刻度上标记ax1.set_xticklabels 图像标签ax1.set_title )、fontsize=15 ) #图2ax2=fig.add 2) PLT.save(myfig.png ) (plt.show )- plt.subplots ) ax=PLT.subplots dpi=100 ) #两行双列ax[0][0].imshow(#x轴和y轴刻度ax[0][0].set_xticks ) ) ax[0].set_yticks fontsize=10 ) #图像标签ax[0][0].set_titititity []#趾四ax[1][1].bar([] ), []]PLT.savefig(myfig.png ) ) plt.show )- plt.subplot ) importmatplot dpi=100 ) #图1 PLT.subplot (2,2,1 ) labels=none(#x和y轴标签PLT.xlabel(sentence )、fontsize=10 ) PLT.ylabel ),用于设置labelsy=none (PLT.y ticks ) 2 ) plt.plot(PLT.subplot ) 2,2,3 ) plt.plot ) PLT.subplot ) 2,2,4 ) plt.plot ) PLT.savefig ) '

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。