Scalable Vector Graphics (SVG) Export of Figures

Converts 3D and 2D MATLAB plots to the scalable vector format (SVG).
49,8K téléchargements
Mise à jour 23 avr. 2021

Note de l’éditeur : This file was a File Exchange Pick of the Week

Scalable Vector Graphics (SVG) Export of Figures

Converts 2D & 3D Matlab plots to the scalable vector format (SVG). This format is specified by W3C ( and can be viewed and printed with internet browsers.

Added preliminary support of filter, clipping, and tickmark extensions that go beyond the Matlab functionality. SVG filters are a great tool to create stylish plots! Try it out! Before you start using this new features have a look at the tutorial.

Editors for the SVG file format can be found at

> plot2svg % opens a file dialog to plot the active figure
> plot2svg('myfile.svg', figure handle, pixelfiletype)

pixelfiletype = 'png' (default), 'jpg'

Supported Features
- line, patch, contour, contourf, quiver, surf, ...
- markers
- image (saved as linked png pictures)
- grouping of elements
- alpha values for patches
- subplot
- colorbar
- legend
- zoom
- reverse axes
- controls are saved as png pictures
- log axis scaling
- axis scaling factors (10^x)
- labels that contain Latex commands are interpreted (with some limitations):
\alpha, \Alpha, \beta, \Beta, ... \infity, \pm, \approx
{\it.....} for italic text
{\bf.....} for bold text
^{...} for superscript
_{...} for subscript

How to use SVG files in HTML code
<object type="image/svg+xml" data="./mySVGfile.svg" width="140" height="100"></object>

- Does not support figure objects that have been introduced for > Matlab R2014b
- axis scaling factors for 3D axes
- 3D plot functionality limited (depth sorting, light)

Citation pour cette source

Juerg Schwizer (2024). Scalable Vector Graphics (SVG) Export of Figures (, GitHub. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2012b
Compatible avec toutes les versions jusqu’à R2014a
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version

See release notes for this release on GitHub:

- 1xn char arrays for tick labels
- Fix for 'Index exceeds matrix dimensions'
- Fix for another axis label problem
- Fix for line style none of rectangles
- Enabled scatter plot functionality

- Fix for degree character
- Fix for problems with dash-arrays
- Modified shape of triangles
- Removed versn as return value of function fileparts
- Fix for images

- Bugfix for ticklabels outside of the axis limits
- Enabled scatter plots using hggroups
- Closing patches if they do not contain NaNs
- Support of the 'Layer' keyword to but the grid on top of
of the other axis content using 'top'

Bugfixes and support of user requests. See 'Changes in Version 06-Mar-2010' for more information.

- Bug fixes for text size / line distance
- Support of background box for text
- Improved support of filters
- Experimental support of animations
- Rework of latex string handling
- 'sub' and 'super' workaround for Firefox and Inkscape

Improved SVG filter support, bugfixes, improved text support, more examples for the advanced filter usage.

Bugfixes and preliminary support of SVG filters, clipping, and improved axis tick labels.

Several bugfixes and better support of 3D graphics

Important bugfix solving the problem described in the last rating.

Many thanks
Juerg Schwizer

Pour consulter ou signaler des problèmes liés à ce module complémentaire GitHub, accédez au dépôt GitHub.
Pour consulter ou signaler des problèmes liés à ce module complémentaire GitHub, accédez au dépôt GitHub.