Getting Started Previous page   Next Page

Saving Figures

Save a figure by selecting Save from the File menu to display a file save dialog. MATLAB saves the data it needs to recreate the figure and its contents (i.e., the entire graph) in a file with a .fig extension.

To save a figure using a standard graphics format, such as TIFF, for use with other applications, select Export Setup from the File menu. You can also save from the command line -- use the saveas command, including any options to save the figure in a different format.

See Exporting the Graph for an example.

Saving Workspace Data

You can save the variables in your workspace using the Save Workspace As item in the figure File menu. You can reload saved data using the Import Data item in the figure File menu. MATLAB supports a variety of data file formats, including MATLAB data files, which have a .mat extension.

Generating M-Code to Recreate a Figure

You can generate MATLAB code that recreates a figure and the graph it contains by selecting the Generate M-File item from the figure File menu. This option is particularly useful if you have developed a graph using plotting tools and want to create a similar graph using the same or different data.

Saving Figures That Are Compatible with Previous Version of MATLAB

Create backward-compatible FIG-files by following these two steps:


Previous page  Axis Labels and Titles Mesh and Surface Plots Next page

© 1994-2005 The MathWorks, Inc.