Matlab - plot window arrangement
Is there a possibility of building a plot window with 8 plot figures disposed in the following manner?
- six of them positioned in a 2 x 3 grid;
- the remaining 2, position in a 1 x 2 grid, underneath the 2 x 3 grid;
I can't u开发者_JAVA百科se the subplot function, because for the fist 6 I would have subplot(2, 3, x)
and for the last 2 I would have subplot(1, 2, x)
.
The last input to the subplot
command need not be an integer and takes decimal offsets. You can use this to create the plot you want, with the two lowest ones centered under the row above with all figures being the same size as in the following example.
figure(1)
subplot(3,3,1)
subplot(3,3,2)
subplot(3,3,3)
subplot(3,3,4)
subplot(3,3,5)
subplot(3,3,6)
subplot(3,3,7.5)
subplot(3,3,8.5)
Here is an example:
figure
subplot(3,3,1), text(0.5,0.5,'1', 'FontSize',20)
subplot(3,3,2), text(0.5,0.5,'2', 'FontSize',20)
subplot(3,3,3), text(0.5,0.5,'3', 'FontSize',20)
subplot(3,3,4), text(0.5,0.5,'4', 'FontSize',20)
subplot(3,3,5), text(0.5,0.5,'5', 'FontSize',20)
subplot(3,3,6), text(0.5,0.5,'6', 'FontSize',20)
subplot(3,2,5), text(0.5,0.5,'7', 'FontSize',20)
subplot(3,2,6), text(0.5,0.5,'8', 'FontSize',20)
精彩评论