天天看點

MATLAB強化學習三:1個figure畫多個子圖與多個figure畫多個子圖

MATLAB強化學習三:1個figure畫多個子圖與多個figure畫多個子圖

1.一個figure畫多個子圖:

figure(10)          % define figure
subplot(2,2,1);     % subplot(x,y,n)x表示顯示的行數,y表示列數,n表示第幾幅圖檔
plot(...);
subplot(2,2,2);
plot(...);
subplot(2,2,3);
plot(...);
subplot(2,2,4);
plot(...);
           

2,多個figure畫多個子圖:

figure(1);         % 第一個子圖
plot(...);
figure(2);         % 第二個子圖
plot(...);
figure(3);
plot(...);
figure(4);
plot(...);
           

繼續閱讀