hFig = figure(1);
set(hFig, 'Position', [x y width height])
1
我设法用以下序列得到了一个好的结果(在开始时运行两次Matlab):
h = gcf; % Current figure handle
set(h,'Resize','off');
set(h,'PaperPositionMode','manual');
set(h,'PaperPosition',[0 0 9 6]);
set(h,'PaperUnits','centimeters');
set(h,'PaperSize',[9 6]); % IEEE columnwidth = 9cm
set(h,'Position',[0 0 9 6]);
% xpos, ypos must be set
txlabel = text(xpos,ypos,'$$[\mathrm{min}]$$','Interpreter','latex','FontSize',9);
% Dump colored encapsulated PostScript
print('-depsc2','-loose', 'signals');
0
figure (1)
hFig = figure(1);
set(gcf,'PaperPositionMode','auto')
set(hFig, 'Position', [0 0 xwidth ywidth])
plot(x,y)
print -depsc2 correlation.eps; % for saving in eps, look up options for saving as png or other formats you may need
5 回答
把它写成 one-liner :
A different approach. 在
figure()
调用指定属性或修改h = figure()
之后的图形句柄属性 .这将基于标准化单位创建全屏图形 .
figure('units','normalized','outerposition',[0 0 1 1])
units
属性可以调整为英寸,厘米,像素等 .见
figure
documentation .This可能对你有帮助吗?
我设法用以下序列得到了一个好的结果(在开始时运行两次Matlab):
这会将图形保存在指定的尺寸中