text annotation

Hi,

I'm a new matplotlib user and I'm already impressed by matplotlib's features!
But I can't find how to do something that looks quite easy.

I have several points making something that looks like a circle.
I would like to anotate these point.
How can I manage the annotation of points forming a circle if I have their coordinates?

Any help would be appreciate.
Thank you.
Ben

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.annotate

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.text

http://matplotlib.sourceforge.net/examples/api/joinstyle.html

hth,
Alan Isaac

···

On 11/26/2010 8:12 AM, Benoist Laurent wrote:

How can I manage the annotation of points forming a circle if I have
their coordinates?

Thank you for your answer.
I read the text and annotate manual pages.

I don't understand how the "polar" xycoords/textcoords works.
I guess I should use this but its not clear to me.

···

Le 26 nov. 10 à 14:13, Alan G Isaac a écrit :

On 11/26/2010 8:12 AM, Benoist Laurent wrote:

How can I manage the annotation of points forming a circle if I have
their coordinates?

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.annotate

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.text

http://matplotlib.sourceforge.net/examples/api/joinstyle.html

hth,
Alan Isaac

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi all,

I’m still a bit stuck with this probleme of polar annotation.

Let me present the problem in a different way.

I’ve got the center of my circle, its radius and even some points on the circle.

Actually, I’d like to annotate these points (red crosses in the joined picture).

How would you do that?

My best try gave me the green numbers.

Thanks in advance,

Ben

test.pdf (78.7 KB)

Can you include the source code (if it is simple) that you used to generate this example, and we could probably help you out.

Ben Root

···

On Wed, Dec 15, 2010 at 9:46 AM, Benoist Laurent <benoist@…3369…5…> wrote:

Hi all,

I’m still a bit stuck with this probleme of polar annotation.

Let me present the problem in a different way.

I’ve got the center of my circle, its radius and even some points on the circle.

Actually, I’d like to annotate these points (red crosses in the joined picture).

How would you do that?

My best try gave me the green numbers.

Thanks in advance,

Ben

Sorry for the delay.
This is the script is used (modified so that it include the data).

toto2.py (15.3 KB)

I don't think "polar" is a good fit for your case. Instead, you can
simply use "data" coordinate with explicit coordinate transformation.
Try something like;

    for i in xrange(5):
        theta = i*1.3+1.5
        xx = center[0]+(radius-4)*math.cos(theta)
        yy = center[1]+(radius-4)*math.sin(theta)
        pyplot.annotate(str(i+1), (xx, yy), color='g', va="center", ha="center")

-JJ

···

On Thu, Dec 16, 2010 at 5:27 PM, Benoist Laurent <benoist@...3355...> wrote:

Sorry for the delay.
This is the script is used (modified so that it include the data).

Le 15 déc. 10 à 16:50, Benjamin Root a écrit :

On Wed, Dec 15, 2010 at 9:46 AM, Benoist Laurent <benoist@...3355...> wrote:

Hi all,
I'm still a bit stuck with this probleme of polar annotation.
Let me present the problem in a different way.
I've got the center of my circle, its radius and even some points on the
circle.
Actually, I'd like to annotate these points (red crosses in the joined
picture).
How would you do that?
My best try gave me the green numbers.
Thanks in advance,
Ben

Can you include the source code (if it is simple) that you used to generate
this example, and we could probably help you out.

Ben Root

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Nice!
Still some stuff to enhance but got it!

Thanks a lot.
Ben

···

Le 19 déc. 10 à 05:30, Jae-Joon Lee a écrit :

I don't think "polar" is a good fit for your case. Instead, you can
simply use "data" coordinate with explicit coordinate transformation.
Try something like;

   for i in xrange(5):
       theta = i*1.3+1.5
       xx = center[0]+(radius-4)*math.cos(theta)
       yy = center[1]+(radius-4)*math.sin(theta)
       pyplot.annotate(str(i+1), (xx, yy), color='g', va="center", ha="center")

-JJ

On Thu, Dec 16, 2010 at 5:27 PM, Benoist Laurent <benoist@...3355...> > wrote:

Sorry for the delay.
This is the script is used (modified so that it include the data).

Le 15 déc. 10 à 16:50, Benjamin Root a écrit :

On Wed, Dec 15, 2010 at 9:46 AM, Benoist Laurent <benoist@...3355...> >> wrote:

Hi all,
I'm still a bit stuck with this probleme of polar annotation.
Let me present the problem in a different way.
I've got the center of my circle, its radius and even some points on the
circle.
Actually, I'd like to annotate these points (red crosses in the joined
picture).
How would you do that?
My best try gave me the green numbers.
Thanks in advance,
Ben

Can you include the source code (if it is simple) that you used to generate
this example, and we could probably help you out.

Ben Root

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users