注解
Click here 下载完整的示例代码
打印标准输出¶
将PNG打印为标准输出
用法:python print_stdout.py>somefile.png
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.savefig(sys.stdout.buffer)
关键词:matplotlib代码示例,codex,python plot,pyplot Gallery generated by Sphinx-Gallery