Matplotlib
摇摆的果冻
这个作者很懒,什么都没留下…
展开
-
Python 作图之Matplotlib(一)
基本用法import matplotlib.pyplot as pltimport numpy as npx = np.linspace(-3, 3, 50)x = np.linspace(-3, 3, 50)y1 = 2*x + 1y2 = x**2plt.figure()plt.plot(x, y)plt.show()设置样式使用plt.figure定义一个图像窗口:编号为3;大...原创 2018-05-23 10:59:11 · 722 阅读 · 0 评论 -
Python 作图之Matplotlib(二)
Legend import matplotlib.pyplot as pltimport numpy as npx = np.linspace(-3, 3, 50)y1 = 2*x + 1y2 = x**2plt.figure()#set x limitsplt.xlim((-1, 2))plt.ylim((-2, 3))# set new sticksnew_stick...原创 2018-05-23 11:08:12 · 481 阅读 · 0 评论 -
Matplotlib 远程画图报错
本地用matplotlib绘图可以,但是在ssh远程绘图的时候会报错matplotlib的默认backend是TkAgg,而FltkAgg, GTK, GTKAgg, GTKCairo, TkAgg , Wx or WxAgg这几个backend都要求有GUI图形界面的,所以在ssh操作的时候会报错查看import matplotlib.pyplot as pltBackend TkAgg is...原创 2018-05-23 12:19:19 · 3284 阅读 · 2 评论