Ctrl+K
Logo image Logo image
  • Plot types
  • Examples
  • Tutorials
  • Reference
  • User guide
  • Develop
  • Release notes
  • Plot types
  • Examples
  • Tutorials
  • Reference
  • User guide
  • Develop
  • Release notes

Section Navigation

  • Lines, bars and markers
  • Images, contours and fields
  • Subplots, axes and figures
  • Statistics
  • Pie and polar charts
  • Text, labels and annotations
  • pyplot
  • Color
  • Shapes and collections
  • Style sheets
  • axes_grid1
  • axisartist
  • Showcase
  • Animation
  • Event handling
  • Miscellaneous
    • Anchored Artists
    • Changing colors of lines intersecting a box
    • Manual Contour
    • Coords Report
    • Custom projection
    • Customize Rc
    • AGG filter
    • Ribbon Box
    • Adding lines to figures
    • Fill Spiral
    • Findobj Demo
    • Font indexing
    • Font properties
    • Building histograms using Rectangles and PolyCollections
    • Hyperlinks
    • Image Thumbnail
    • Plotting with keywords
    • Matplotlib logo
    • Multipage PDF
    • Multiprocess
    • Packed-bubble chart
    • Patheffect Demo
    • Print Stdout
    • Pythonic Matplotlib
    • Rasterization for vector graphics
    • Set and get properties
    • SVG Filter Line
    • SVG Filter Pie
    • Table Demo
    • TickedStroke patheffect
    • transforms.offset_copy
    • Zorder Demo
  • 3D plotting
  • Scales
  • Specialty Plots
  • Spines
  • Ticks
  • Units
  • Embedding Matplotlib in graphical user interfaces
  • Userdemo
  • Widgets

Note

Click here to download the full example code

Print Stdout#

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)

Download Python source code: print_stdout_sgskip.py

Download Jupyter notebook: print_stdout_sgskip.ipynb

Gallery generated by Sphinx-Gallery

© Copyright 2002–2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012–2022 The Matplotlib development team.

Created using Sphinx 5.2.3.