Save charts (export)
Matplotlib Basics
1 min read
This section is 1 min read, full guide is 24 min read
Published Oct 5 2025
15
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
ChartsGraphsMatplotlibNumPyPandasPythonVisualisation
Basic saving command
You save any Matplotlib figure with:
plt.savefig('filename.png')
Copy to Clipboard
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'
)
Copy to Clipboard
Toggle show comments














