The easiest way to do this is use a non-interactive backend (see What
is a backend?) such as Agg (for PNGs), PDF, SVG or PS. In your
figure-generating script, just call the matplotlib.use() directive
before importing pylab or pyplot:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.savefig('myfig')
我没有一个SunPy环境来测试这个,但是你能给下面的一个镜头吗?你知道吗
基于Generate images without having a window appear:
相关问题 更多 >
编程相关推荐