0
votes

I want to create a 3x3 matrix of plots in MATLAB where each element is a subplot of some corresponding 1000 samples (suppose values are stored in a 3x3x1000 matrix A). I want the subplots to be spaced very close together, and the y axis numbers/labels to only show up for the left subplots and the x axis numbers/labels to only show up for the bottom subplots.

For example, something similar to plotmatrix, except subplot ij would plot A(i,j,:). plotmatrix example

Is there an easy way to do this in MATLAB? Thanks!

2

2 Answers

0
votes

The axes properties of the subplots can be modified to achieve this, but an easier way would be to use a FEX submission called panel. Have a look at its example output:

enter image description here

0
votes

subplot can do that for you in MATLAB.

h = subplot(3,3,1) 

Will split the current figure in a 3 x 3 matrix and creates an axes(area where you plot something) in the 1st cell of the matrix. h is the "handle" to the axes which you can then use to modify the xlabels and ylabels in any way.

Documentation for subplot

Documentation for Axes