使用 python matplotlib 画矩形
1、绘制矩形
python matplotlib 绘制矩形,简单的几行代码就可以实现,简单易懂,方便利用。
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 11 18:12:37 2016@author: Eddy_zheng
"""import matplotlib.pyplot as plt
import 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')
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
