首页 > 学院 > 开发设计 > 正文

matplotlib常用命令

2019-11-08 18:53:10
字体:
来源:转载
供稿:网友
import matplotlib.pyplot as pltimport numpy as npx=np.linspace(-10,10,500)plt.plot(x, y, 'g', label='myfunction')plt.ylim(-0.2, 0.4)plt.legend(loc='lower right', PRop={'size': 11})

set axis range

plt.xlim(minx,maxx)plt.ylim(miny,maxy)

set color and line type

color: g,b,k,r,… type: ‘g:’, ‘k-‘, ‘b–’, ‘r-.’

set label

plt.plot(x,y,label="mylabel")plt.legend(loc="lower right")
上一篇:汉诺塔问题

下一篇:Comparable接口

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表