Thread Subject:
Pin To Axes

Subject: Pin To Axes

From: Yoav Mor

Date: 21 Sep, 2005 10:47:35

Message: 1 of 6

Hi,

I'm creating a subplot and a line notation on top.
I'm trying to pin my line to the plot and cannot find any function
that does so.

my schematic code is:

-------------------------------------------------
a = figure();
b(1) = subplot (2,1,1);
b(2) = subplot (2,1,2);
plot (b(1),[1:10:1000]);
plot (b(2),[1000:-10:1]);
anno2 = annotation('line',[0.5 0.5],[0.2 0.8]);
% <- At this stage I want to pin it...
-------------------------------------------------

of course that by right-clicking on the annotation I can perform this
but I need to do it dynamically within my function.

Is that possible?

Subject: Pin To Axes

From: PB

Date: 21 Sep, 2005 13:18:15

Message: 2 of 6

Yoav Mor wrote:
>
>
> Hi,
>
> I'm creating a subplot and a line notation on top.
> I'm trying to pin my line to the plot and cannot find any function
> that does so.
>
> my schematic code is:
>
> -------------------------------------------------
> a = figure();
> b(1) = subplot (2,1,1);
> b(2) = subplot (2,1,2);
> plot (b(1),[1:10:1000]);
> plot (b(2),[1000:-10:1]);
> anno2 = annotation('line',[0.5 0.5],[0.2 0.8]);
> % <- At this stage I want to pin it...
> -------------------------------------------------
>
> of course that by right-clicking on the annotation I can perform
> this
> but I need to do it dynamically within my function.
>
> Is that possible?

Hi Yoav!

I assume that you are familiar with handle graphics, i.e. working
with set/get inside your code to customize plots etc. If you are not,
then read that part of the documentation. Looking at anno2 using get,
you´ll see that the only thing that happens is that two children are
added to the annotation object:

% run your posted code:
v=get(anno2,'Children')
% pin the line by right-clicking and so on ...
v2=get(anno2,'Children')

Now you can see that two more handles have been added to your stack
of Children. Take a look at them, again using get:

a1=get(v2(1))
a2=get(v2(2))

As you can see these are line object with some properties. I think
that all you´ll have to do is to find out a way to reproduce a these
lineobjects and add them as children to your annotation.

Anyway, this is just the way I would handle this.

HTH

PB

Subject: Pin To Axes

From: Yoav Mor

Date: 22 Sep, 2005 02:36:23

Message: 3 of 6

Hi,

Thanks for replying. However, this is not working.

I saw that my annotation gets 2 new children whenever I pin it with
the right click. However, when I try to save these children's
properties, remove the pins and then load these properties again -
this is not working.

There has to be an easier way and I can't find *anything* about it on
the web or in the matlab help.

Any more ideas?

Thank you so far.
Y.

Subject: Pin To Axes

From: Yoav Mor

Date: 22 Sep, 2005 02:45:56

Message: 4 of 6

Replying to myself...

I found out that to activate the annotation matlab uses a file called
scribepin.m
I cannot find any help about this method...

Any further ideas?

Thanks again.
Y.

Yoav Mor wrote:
>
>
> Hi,
>
> Thanks for replying. However, this is not working.
>
> I saw that my annotation gets 2 new children whenever I pin it with
> the right click. However, when I try to save these children's
> properties, remove the pins and then load these properties again -
> this is not working.
>
> There has to be an easier way and I can't find *anything* about it
> on
> the web or in the matlab help.
>
> Any more ideas?
>
> Thank you so far.
> Y.

Subject: Pin To Axes

From: Serkan Bozkurt

Date: 8 Feb, 2011 08:16:03

Message: 5 of 6

"Yoav Mor" <mor_yoav@yahoo.com> wrote in message <ef15c96.2@webx.raydaftYaTP>...
> Replying to myself...
>
> I found out that to activate the annotation matlab uses a file called
> scribepin.m
> I cannot find any help about this method...
>
> Any further ideas?
>
> Thanks again.
> Y.
>
> Yoav Mor wrote:
> >
> >
> > Hi,
> >
> > Thanks for replying. However, this is not working.
> >
> > I saw that my annotation gets 2 new children whenever I pin it with
> > the right click. However, when I try to save these children's
> > properties, remove the pins and then load these properties again -
> > this is not working.
> >
> > There has to be an easier way and I can't find *anything* about it
> > on
> > the web or in the matlab help.
> >
> > Any more ideas?
> >
> > Thank you so far.
> > Y.

Hi to all

I am suffering the same problem.

Is there any func. for setting pin to axes functionality dinamically in m code?

Let explain my need for this func. maybe another solution comes without need for usage of this func. I have 2-D graph that x axis is time data and y axis is some position data. Beside this time vs position graph I need to show source of position data which can be source 1 or source 2 on the same graph. Also I need to show
state of source which can be on or off. That means I have time, position, source number and source states data to be shown on 2D graph. Is there any reommend about how to display them?

Note that Firstly I think use of double arrow for display source and source state but I need to use pin to axes for zooming functionality.

Subject: Pin To Axes

From: vairis.caune@gmail.com

Date: 1 Jul, 2013 08:43:25

Message: 6 of 6

On Wednesday, September 21, 2005 4:47:35 PM UTC+2, Yoav Mor wrote:
> Hi,
>
> I'm creating a subplot and a line notation on top.
> I'm trying to pin my line to the plot and cannot find any function
> that does so.
>
> my schematic code is:
>
> -------------------------------------------------
> a = figure();
> b(1) = subplot (2,1,1);
> b(2) = subplot (2,1,2);
> plot (b(1),[1:10:1000]);
> plot (b(2),[1000:-10:1]);
> anno2 = annotation('line',[0.5 0.5],[0.2 0.8]);
> % <- At this stage I want to pin it...
> -------------------------------------------------
>
> of course that by right-clicking on the annotation I can perform this
> but I need to do it dynamically within my function.
>
> Is that possible?

This should help to the persons interested in pinning the points to the axes (provided that people still get stuck with this):
http://undocumentedmatlab.com/blog/pinning-annotations-to-graphs/
Good luck

Tags for this Thread

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.

rssFeed for this Thread

Contact us