Hinweis
Zum Ende springen, um den vollständigen Beispielcode herunterzuladen.
Bild auf stdout ausgeben#
png auf standardausgabe ausgeben
verwendung: 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)