Matlab - plot window arrangement

Simon picture Simon · Jul 30, 2011 · Viewed 8.3k times · Source

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 use 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).

Answer

abcd picture abcd · Jul 30, 2011

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)

enter image description here