Thread Subject: outerPosition changes when xlabel is moved

Subject: outerPosition changes when xlabel is moved

From: craq

Date: 9 Nov, 2011 16:49:31

Message: 1 of 1

The outerPosition property usually includes the xlabel, ylabel, and (as far as I can tell) all children of an axis. But after moving the xlabel, the outerPosition now ignores it, and the lower limit corresponds to the xticklabel.

plot(1:10)
xlabel('xlabel')
set(gca,'position',[0.3 0.3 0.3 0.3])
xlp=get(get(gca,'xlabel'),'position');
oP1=get(gca,'outerPosition')
set(get(gca,'xlabel'),'position',xlp)
oP2=get(gca,'outerPosition')
set(get(gca,'xlabel'),'position',xlp*0.9999)
oP3=get(gca,'outerPosition')

of the axes properties, only outerPosition and extent have changed. The properties of the xlabel itself are identical to before. Is this a bug?

I want to align the xlabels on several axes, and use the outerPosition property to check that they haven't drifted out of the figure, or overlap the xticklabels. If I can't rely on the outerPosition property, does anybody know how to do this?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
outerposition craq 9 Nov, 2011 11:54:30
extent craq 9 Nov, 2011 11:54:30
xlabel craq 9 Nov, 2011 11:54:30
ylabel craq 9 Nov, 2011 11:54:30
axes craq 9 Nov, 2011 11:54:30
rssFeed for this Thread

Contact us at files@mathworks.com