Code covered by the BSD License
-
copyfig(fh)
COPYFIG Create a copy of a figure, without changing the figure
-
eps2pdf(source, dest, crop, a...
EPS2PDF Convert an eps file to pdf format using ghostscript
-
export_fig(varargin)
EXPORT_FIG Exports figures suitable for publication
-
fix_lines(fname, fname2)
FIX_LINES Improves the line style of eps files generated by print
-
ghostscript(cmd)
GHOSTSCRIPT Calls a local GhostScript executable with the input command
-
isolate_axes(ah, vis)
ISOLATE_AXES Isolate the specified axes in a figure on their own
-
pdf2eps(source, dest)
PDF2EPS Convert a pdf file to eps format using pdftops
-
pdftops(cmd)
PDFTOPS Calls a local pdftops executable with the input command
-
print2array(fig, res, rendere...
PRINT2ARRAY Exports a figure to an image array
-
print2eps(name, fig, varargin...
PRINT2EPS Prints figures to eps with improved line styles
-
user_string(string_name, stri...
USER_STRING Get/set a user specific string
-
View all files
from
export_fig
by Oliver Woodford
Exports figures nicely to a number of vector & bitmap formats.
|
| copyfig(fh)
|
%COPYFIG Create a copy of a figure, without changing the figure
%
% Examples:
% fh_new = copyfig(fh_old)
%
% This function will create a copy of a figure, but not change the figure,
% as copyobj sometimes does, e.g. by changing legends.
%
% IN:
% fh_old - The handle of the figure to be copied. Default: gcf.
%
% OUT:
% fh_new - The handle of the created figure.
% Copyright (C) Oliver Woodford 2012
function fh = copyfig(fh)
% Set the default
if nargin == 0
fh = gcf;
end
% Is there a legend?
if isempty(findobj(fh, 'Type', 'axes', 'Tag', 'legend'))
% Safe to copy using copyobj
fh = copyobj(fh, 0);
else
% copyobj will change the figure, so save and then load it instead
tmp_nam = [tempname '.fig'];
hgsave(fh, tmp_nam);
fh = hgload(tmp_nam);
delete(tmp_nam);
end
return
|
|
Contact us