📄 printsafe.m
字号:
function PrintSafe(theFigures, theOptions)% PrintSafe -- Safely print figures.% PrintSafe(theFigure, 'theOptions') prints theFigures% (default = current-figure), using 'theOptions'. This% routine temporarily disables the 'ResizeFcn' property% and applies the '-noui' option automatically. Any% additional options are provided in a string that is% appended to the "print" command. For example, use% "printsafe(gcf, '-loose') to impose the 'PaperPosition'% property of each figure onto the corresponding PostScript% "BoundingBox".% PrintSafe('theOptions') performs "printsafe(gcf, theOptions)".if nargin < 1, help(mfilename), theFigures = gcf; endif nargin < 2, theOptions = ''; endif isstr(theFigures) if theFigures(1) ~= '-' theFigures = eval(theFigures); else theOptions = theFigures; theFigures = gcf; endendf = findobj('Type', 'figure');if ~any(f), return, endtheGCF = gcf;for k = 1:length(theFigures) figure(theFigures(k)) theResizeFcn = get(theFigures(k), 'ResizeFcn'); set(theFigures(k), 'Resizefcn', '') theCommand = ['print -noui -f' num2str(theFigures(k)) ' ' theOptions]; eval(theCommand, ['disp(['' ## Not successful '' theCommand])']) set(theFigures(k), 'Resizefcn', theResizeFcn)endfigure(theGCF)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -