saveas

Save figure to specific file format.

Syntax

  • saveas(fig, filename)

  • saveas(fig, filename, formattype)

Input argument

  • fig - figure object.

  • filename - character vector or scalar string: destination filename.

  • formattype - character vector or scalar string: extension filename.

Description

saveas save figure to specific file format.

supported formats:

OptionFormatFile extension

svg

SVG (scalable vector graphics)

.svg

pdf

Full page Portable Document Format (PDF) color

.pdf

png

PNG 24-bit

.png

jpg

JPEG 24-bit

.jpg

Example

x = -2:0.25:2;
y = x;
[X,Y] = meshgrid(x);
F = X.*exp(-X.^2-Y.^2);
surf(X,Y,F);
saveas(gcf(), 'svg-file.svg');

See also

gcf.

History

VersionDescription

1.0.0

initial version

Author

Allan CORNET

Last updated