我想让Matlab 7.10.0.499 (R2010a)使用print
命令将图形输出为eps格式,但无论我将图形设置为哪种纸张大小,它总是会裁剪掉坐标轴标签,除非我将其设置为A3大小。
这是一个PNG图片,用于说明问题(尽管我知道PNG文件是由不同的渲染管道生成的):
生成此图形的代码如下:
figure,
set(gcf, 'renderer', 'painters');
loglog(p_m_tt, p_fa_tt, 'k-', 'LineWidth', 2); hold on;
loglog(p_m_oo, p_fa_oo, 'k--', 'LineWidth', 2); hold on;
loglog(p_m_ot, p_fa_ot, 'k-.', 'LineWidth', 3); hold on;
fontSize = 9;
l = legend('Cam1-Cam1', 'Cam2-Cam2', 'Cam2-Cam1', ...
'Location', 'NorthEast');
fontSize = 20;
xlabel('$P_{fa}$', 'fontsize', fontSize);
ylabel('$P_{m}$', 'fontsize', fontSize);
set(gca, 'XMinorTick', 'off', 'YMinorTick', 'off', 'YGrid', 'on', 'XGrid', 'on');
set(gcf, 'PaperPositionMode', 'auto');
set(gca, 'XTick', [0.00001 0.0001 0.001 0.01 0.1 1]);
set(gca, 'MinorGridLineStyle', 'none');
set(gca, 'FontSize', fontSize);
set(gcf, 'defaultAxesFontName', 'Times New Roman');
axis square;
X = 13;
Y = 13;
xMargin = 0.25; %# left/right margins from page borders
yMargin = 0.25; %# bottom/top margins from page borders
xSize = X - 2*xMargin; %# figure size on paper (widht & height)
ySize = Y - 2*yMargin;
set(gcf, 'PaperUnits', 'centimeters');
set(gcf, 'PaperSize', [X Y]);
set(gcf, 'PaperPosition', [0 0 xSize ySize]);
print('-depsc2', f);