2

So I have a 3x3 array of subplots. I know how to get a title on each one of them, and I know how to get a "super title" using the suptitle function over the whole thing, but I can't figure out how to get titles to only show up over each column. I also want to do a similar thing with the rows. Think hip, knee, ankle across the top, then angular velocity, torque, and power down the left side. Thoughts?

4

2 回答 2

5

You can use text to label the columns and rows.

subplot(2,2,1)
title('a')
h1 = text(-0.25, 0.5,'row 1');
set(h1, 'rotation', 90)
text(0.35,1.2,'column 1');

subplot(2,2,2)
title('b')
text(0.35,1.2,'column 2');
subplot(2,2,3)

title('c')
h = text(-0.25, 0.5, 'row 2');
set(h, 'rotation', 90)
subplot(2,2,4)
title('d')

The position of text will have to be adjusted based on the x and y range of your plots.

于 2013-03-29T19:30:06.370 回答
0

As noted in the comments to the other answer, you can do this using titles and y-labels in individual subplots.

在图的第一行使用title以生成列标签。对于行标签,请利用(可能未记录?)功能,该功能允许您拥有多行标签,因此:

ylabel({'Row label' 'Actual y-label'});

这是一个令人讨厌的 kludge,如果您的子图是在循环中生成的,它就是一个 PITA,但直到/除非 Mathworks 给我们提供了一种正确的方法来做到这一点,这是我所知道的最好的。

于 2017-01-20T11:42:11.500 回答