我有一張圖,上面有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線I設置的數字窗口,使得2個圖是足夠寬。但是,當我嘗試保存圖形時,圖像是其中圖塊被壓扁的默認大小。
我錯過了什麼?
可能重複(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合MATLAB的閉合) – Amro