Thread Subject: Axes position

Subject: Axes position

From: matthias

Date: 1 Feb, 2012 12:13:10

Message: 1 of 3

Hello all,

I would like to add a logo on a plot.
I don't want it to move away when I zoom or pan, so I put it into a dedicated axes object that will stand still.
I want that axes object to stick to the top-right corner of my plot so I set it's position property, based on the plot axes position, with something like that:
p1 = get(hAxes1,'position');
set(hAxes2,'position',[p1(1)+p1(3)-width p1(2)+p1(4)-height width height]);

After that I hope the top-right corners of the plot boxes will be exactly superimposed.

But they are not: the plot axes (hAxes1) has been set with "axis equal", so its position property does not reflect the actual position of its plot box.

Do anyone know how I still can get the "real" position of that plot box without abandoning the "axis equal" setting ?

Thanks a lot in advance.

matthias

Subject: Axes position

From: Suraj

Date: 1 Feb, 2012 16:05:10

Message: 2 of 3

even I do have a similar question...All I need is the output of vision.videoplayer, how can I insert onto GUI axes i've created, any idea?

Subject: Axes position

From: TideMan

Date: 1 Feb, 2012 19:41:03

Message: 3 of 3

On Feb 2, 1:13 am, "matthias " <matthia...@hotmail.com> wrote:
> Hello all,
>
> I would like to add a logo on a plot.
> I don't want it to move away when I zoom or pan, so I put it into a dedicated axes object that will stand still.
> I want that axes object to stick to the top-right corner of my plot so I set it's position property, based on the plot axes position, with something like that:
> p1 = get(hAxes1,'position');
> set(hAxes2,'position',[p1(1)+p1(3)-width p1(2)+p1(4)-height width height]);
>
> After that I hope the top-right corners of the plot boxes will be exactly superimposed.
>
> But they are not: the plot axes (hAxes1) has been set with "axis equal", so its position property does not reflect the actual position of its plot box.
>
> Do anyone know how I still can get the "real" position of that plot box without abandoning the "axis equal" setting ?
>
> Thanks a lot in advance.
>
> matthias

I think you're getting things mixed up.
Setting axes equal has no effect on the position property of gca.
Try this:
clf
get(gca,'Position')
set(gca,...
   'DataAspectRatio',[1 1 1])
get(gca,'Position')

But maybe you're doing something different?

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
axes matthias 1 Feb, 2012 07:14:11
plotboxaspectratio matthias 1 Feb, 2012 07:14:11
rssFeed for this Thread

Contact us at files@mathworks.com