printsafe.m

来自「一些制作正交曲线网格的matlab源程序」· M 代码 · 共 42 行

M
42
字号
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 + =
减小字号Ctrl + -
显示快捷键?