[Scilab-users] X Y coordinates in a scilab plot

Serge Steer Serge.Steer at inria.fr
Thu Mar 28 16:59:48 CET 2013


Le 28/03/2013 14:39, Stephane BECU a écrit :
>
> Thanks Serge for your reply, but I'm not sure it answered my 
> problem. In fact I want to know how to calculate the appropriate 
> coordinates to place the ttext at the relevant poisiton of my plot...
>
How do you define "the appropriate coordinates"?

Please find below an example of string placement

t=linspace(0,2*%pi,100);
clf;plot(t,sin(t))
//now I want to draw a string  at different locations
str="Scilab";
rect=xstringl(0,0,str);
//the lower left corner of the rectangle surrounding the string 
positionned at the (3,sin(3)) point
plot(3,sin(3),'xr')
xstring(3,sin(3),str)
e=gce();e.box='on';
//the upper left corner of the rectangle surrounding the string is 
positionned at the (3,sin(3)) point
plot(2,sin(2),'xr')
xstring(2,sin(2)-rect(4),str)
e=gce();e.box='on';

Serge
> ------------------------------------------------------------------------
> *De :* users-bounces at lists.scilab.org de la part de Serge Steer
> *Envoyé :* mercredi 27 mars 2013 18:58
> *À :* International users mailing list for Scilab.
> *Objet :* Re: [Scilab-users] X Y coordinates in a scilab plot
>
> Le 27/03/2013 14:38, Stephane BECU a écrit :
>>
>> Hello,
>>
>> I'd like to add a characters string in a scilab plot. Using the 
>> "xstring()" function , I have to fix the positon of the text giving 
>> the X Y coordinates of the left bottom point of the box containing 
>> the text. I was wondring where was the origin position and how to 
>> know which distance should be considered?
>>
> The string is supposed enclosed into a rectangle. The coordinates 
> required for xstring are the coordinates of the top left corner of the 
> rectangle
> If you want to know the actual dimension of the minimal rectangle 
> containing a string you may use the xstringl function.
> Serge Steer
>>
>> Thanks for help,
>>
>> Stéphane
>>
>> Maya Technologies 	*Stephane BECU*
>>
>> Tel:+33 4 38 49 59 01
>> Mobile:
>> www.maya-technologies.com <http://www.maya-technologies.com>
>>
>> 	*Maya technologies*
>> La Petite Halle
>> ZAC Bouchayer Viallet
>> 31, rue Gustave Eiffel
>> 38 000 Grenoble
>>
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130328/147bd719/attachment.htm>


More information about the users mailing list