Opening the book…
Sometimes you may want to save a MATLAB figure so that you can reopen and edit it later. MATLAB figure files use the .fig extension.
Saving a plot and opening an existing plot.
clear; clc; clf;
x = linspace(1, 10, 30);
y = x.^2;
plot(x, y, 'md')
title('y = x^2')
xlabel('x')
ylabel('y')
grid on
% Save the current figure
savefig('myplot.fig')
% Close all open figure windows
close all
% Reopen the saved figure
openfig('myplot.fig')
Solution
After running the code in MATLAB, notice that a new file called myplot.fig appears in the current working directory.
The generated plot:

A .fig file is useful when you want to reopen the figure in MATLAB and continue editing it. If you want to include a plot in a report, you may also export it as an image file, such as PNG, or copy it directly into your document.
This page titled 10.14: Saving and Opening Figures was last modified on Tue, 30 Jun 2026 02:11:47 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Zara Noroozi.
The book could not be loaded just now.