Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align the ylabel in subplots

Tags:

matlab

I have several subplots (one beneath the other), and the y-axis of each subplots ticks with different values (say the first is 1:5 and the second is 10:1000 etc.)

So the result is that each ylabel will have different alignment. Is there a way to fix this? For example - to align all the ylabels to the left? Or is there another solution?

like image 496
RNTL Avatar asked May 17 '12 11:05

RNTL


1 Answers

Try this:

xpos = -18 % (find this out from get(yl,'pos') on the desired label x-location)
yl=ylabel('Label Here')
pos=get(yl,'Pos')
set(yl,'Pos',[xpos pos(2) pos(3)])

similarly, do this for each subplot. You will find the x-location is retained throughout, and the other positions are default.

like image 60
Aclariont Avatar answered Nov 03 '22 15:11

Aclariont