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