Note
Click here to download the full example code
print png to standard out
usage: 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)
Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery