saveplot.m

来自「approximate reinforcement learning」· M 代码 · 共 19 行

M
19
字号
function saveplot(figh, savepath, plottarget)
% Saves figure FIGH to SAVEPATH according to PLOTTARGET specification
%   SAVEPLOT(FIGH, SAVEPATH, PLOTTARGET)

if isempty(figh), figh = gcf; end;

switch plottarget,
    case 'latex',        
        saveas(figh, [savepath '.fig'], 'fig');
        saveas(figh, [savepath '.eps'], 'psc2');
    case 'beamer',
        saveas(figh, [savepath '.fig'], 'fig');
        % override resolution for PNGs
        print(['-f' num2str(figh)], '-dpng', '-r300', [savepath '.png']);
%         saveas(figh, [savepath '.png'], 'png');
    case {'screen', ''},  % do nothing
    otherwise,      % do nothing
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?