1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 使用 python matplotlib 画矩形

使用 python matplotlib 画矩形

时间:2022-06-03 06:03:27

相关推荐

使用 python matplotlib 画矩形

1、绘制矩形

python matplotlib 绘制矩形,简单的几行代码就可以实现,简单易懂,方便利用。

# -*- coding: utf-8 -*-"""Created on Thu Aug 11 18:12:37 @author: Eddy_zheng"""import matplotlib.pyplot as pltimport matplotlib.patches as patchesfig1 = plt.figure()ax1 = fig1.add_subplot(111, aspect='equal')ax1.add_patch(patches.Rectangle((0.1, 0.1), # (x,y)0.5,# width0.5,# height))fig1.savefig('rect1.png', dpi=90, bbox_inches='tight')

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。