matlab: putting a circled number onto a graph

Posted by Jason S on Stack Overflow See other posts from Stack Overflow or by Jason S
Published on 2012-05-30T14:31:09Z Indexed on 2012/05/31 16:40 UTC
Read the original article Hit count: 144

Filed under:
|
|

I want to put a circled number on a graph as a marker near (but not on) a point. Sounds easy, but I also want to be invariant of zoom/aspect ratio changes.

Because of this invariant, I can't draw a circle as a line object (without redrawing it upon rescale); if I use a circle marker, I'd have to adjust its offset upon rescale.

The simplest approach I can think of is to use the Unicode or Wingdings characters ① ② ③ etc. in a string for the text() function. But unicode doesn't seem to work right, and the following sample only works with ① and not for the other numbers (which yield rectangle boxes):

works:

clf; text(0.5,0.5,char(129),'FontName','WingDings')

doesn't work (should be a circled 2):

clf; text(0.5,0.5,char(130),'FontName','WingDings')

What gives, and can anyone suggest a workaround?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about annotations