Hướng dẫn dùng savefig matlab python
Main Content Show
savefigSave figure and contents to FIG-file SyntaxDescriptionexample
example
Examplescollapse all Save Current Figure to FIG-FileCreate a surface plot of the figure
surf(peaks)
savefig('PeaksFile.fig')
To open the saved figure, use the command: openfig('PeaksFile.fig'); MATLAB creates a new figure using the saved Save Multiple Figures to FIG-FileCreate two plots and store the figure handles in array h(1) = figure;
z = peaks;
surf(z)
h(2) = figure;
plot(z)
savefig(h,'TwoFiguresFile.fig')
close(h) To open the two figures, use the command: figs = openfig('TwoFiguresFile.fig');
Save Figure Using 'compact' OptionSave a figure using the compact option: h = figure surf(peaks) savefig(h,'PeaksFile.fig','compact') To open the figure, use the command: openfig('PeaksFile.fig'); Input Argumentscollapse all H — One or more figures single figure | array of figuresOne or more figures, specified as a single figure or an array of figures. filename — File name 'Untitled.fig' (default) | character vector | stringFile name, specified as a character vector or string. If you do not specify a file name, then MATLAB saves the file as If the specified file name does not include a Example: Data Types: 'compact' — File format for R2014b or later releases 'compact'File format for R2014b or later releases of MATLAB, specified as Tips
Version HistoryIntroduced in R2013b |