私は2つのプロットを持つ図を持っています。私は図をより長い幅のpngとして保存しようとしています。定義済みのサイズのMatlab保存図
%%%%%%%%%%%%First%%%%%%%%%%%%%%%%%%
a=figure('Name','First Structure');
load C:\Users\William\workspace\P5\FirstAdd.txt
n=FirstAdd(:,1);
t=FirstAdd(:,2);
subplot(1,2,1);
plot(n,t);
xlabel('n');
ylabel('Time');
title('First Structure''s Add');
grid on
load C:\Users\William\workspace\P5\FirstContains.txt
n=FirstContains(:,1);
t=FirstContains(:,2);
subplot(1,2,2);
plot(n,t);
xlabel('n');
ylabel('Time');
title('First Structure''s Contains');
grid on
rect=[250,250,1080,480];
set(a, 'OuterPosition',rect);
print(a,'-dpng','First Structure.png');
最後の3行では、2つのプロットが十分に広いようにFigureウィンドウを設定しました。しかし、図を保存しようとすると、画像はプロットが潰れているデフォルトのサイズになります。
私には何が欠けていますか?
[紙の上に正確な寸法でMATLABプロットの印刷]の可能な重複は(http://stackoverflow.com/questions/3600945/printing- a-matlab-plot-in-exact-dimensions-on-paper)、[カスタムサイズの数値をMATLABに保存する方法](http://stackoverflow.com/questions/6508233/how-to-save-custom-sized -figures-in-matlab-closed) – Amro