Version 3.3.3
matplotlib
Fork me on GitHub
  • Installation
  • Documentation
  • Examples
  • Tutorials
  • Contributing

导航

  • 索引
  • 模块 |
  • home| 
  • contents »
  • 打印标准输出

Related Topics

  • Documentation overview

注解

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)
Download Python source code: print_stdout_sgskip.py
Download Jupyter notebook: print_stdout_sgskip.ipynb

关键词:matplotlib代码示例,codex,python plot,pyplot Gallery generated by Sphinx-Gallery

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2021 The Matplotlib development team.
上次更新时间: 1月 02, 2021 。 创建使用 Doc version v3.3.3-11-g0c8feb04e.