Save charts (export)

Matplotlib Basics

1 min read

Published Oct 5 2025


15
0
0
0

ChartsGraphsMatplotlibNumPyPandasPythonVisualisation

Basic saving command

You save any Matplotlib figure with:

plt.savefig('filename.png')




Common file formats supported

Matplotlib supports raster and vector formats — depending on what you need (for screen display vs. print).

Raster file formats supported:

  • .png
  • .jpg / .jpeg
  • .tif / .tiff
  • .bmp

Vector file formats supported:

  • .pdf
  • .svg
  • .eps
  • .ps




Useful parameters

You can control image size, quality, and layout:

plt.savefig(
    # filename + extension decides format
    'chart.svg',
    # dots per inch (resolution)
    dpi=300,
    # trims extra whitespace
    bbox_inches='tight',
     # transparent background
    transparent=True,
    # background color
    facecolor='white'
)
© 2025 SimpleSteps.guide
AboutFAQPoliciesContact