Note

Go to the endto download the full example code.

Print image to stdout#

print png to standard out

usage: python print_stdout.py > somefile.png

importsysimportmatplotlibmatplotlib.use('Agg')importmatplotlib.pyplotaspltplt.plot([1,2,3])plt.savefig(sys.stdout.buffer)

Gallery generated by Sphinx-Gallery