Add LaTeX expression

rouxph rouxph.22 at gmail.com
Sun Jun 12 23:31:06 CEST 2011


Le 12/06/2011 17:57, Orbeman a écrit :
>
> When I use xstring with coordinates x,y. How can I do to keep relative
> coordinate, ie : 0<x,y<1 and not dependable with the coordinates of any
> graph in the same window and subplot ?

it is not obvious, let's take an example :


plot2d(0,0,1,rect=[-1,-2,1,2],axesflag=0),xtring(0,0,"abcdefg")
a=gca()//current axes
t=a.children(1) // "abcdefg" Text handle

to keep relative coordinates you should use  a.data_bounds (the 
rect=...) to know the bounds of the figure and stringbox(t) to calculate 
the size of the box which contains the Text Handle t :

-->a.data_bounds
  ans  =

   - 1.  - 2.
     1.    2.

-->stringbox(t)
  ans  =

     0.    0.           0.1923497    0.1923497
     0.    0.1739130    0.1739130    0.

Philippe.




More information about the users mailing list