Re: [Scilab-users] color under a curve

2013-03-15 Thread grivet

Thank you Adrien and Christophe.

The code provided by Christophe is specially simple and elegant, but assumes
the function to be strictly positive. Filled areas are different when I 
change

x to x = linspace(-2*%pi,2*%pi,100).
For my purposes, it seems best to use xfpoly() for each region where the
function has a constant sign. The drawback is that color choices are not
as versatile as with plot().

JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] strange behavior of function xstring

2013-03-15 Thread grivet

Hello,
I have noticed the following strange behavior of function xstring.

This piece of code works fine:

clear; clf();
s = A;
plot2d(0,0,-1,010, ,[-2,-2,2,2]);
xstring(0.5,0.5,s);

This one does not (simplified exemple, no useful purpose):

clear; clf();
function etiq(x,y)
s = A;
xstring(x,y,s};
endfunction
plot2d(0,0,-1,010, ,[-2,-2,2,2]);
etiq(0.5,0.5);

Scilab stops with error message

xstring(x,y,s};
   !--error 2
Facteur invalide.
at line   3 of function etiq called by :

What do I do wrong?
JP Grivet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] strange behavior of function xstring

2013-03-15 Thread Станислав

15.03.2013 16:18, grivet пишет:

Hello,
I have noticed the following strange behavior of function xstring.

This piece of code works fine:

clear; clf();
s = A;
plot2d(0,0,-1,010, ,[-2,-2,2,2]);
xstring(0.5,0.5,s);

This one does not (simplified exemple, no useful purpose):

clear; clf();
function etiq(x,y)
s = A;
xstring(x,y,s};
endfunction
plot2d(0,0,-1,010, ,[-2,-2,2,2]);
etiq(0.5,0.5);

Scilab stops with error message

xstring(x,y,s};
   !--error 2
Facteur invalide.
at line   3 of function etiq called by :

What do I do wrong?
JP Grivet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Hi.
Pay attention to brace!
xstring(x,y,s}

Stanislav
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] color under a curve

2013-03-15 Thread Dang, Christophe
Hello,

De la part de grivet
Envoyé : vendredi 15 mars 2013 10:58

 For my purposes, it seems best to use xfpoly()
 for each region where the function has a constant sign.

You can also perform several plot(),
one for each region.

 The drawback is that color choices are not as versatile
 as with plot().

It is.
All the colours of a colourmap are available.
You should have a look at the help for colormap, color and getcolor

http://help.scilab.org/docs/5.4.0/en_US/colormap.html

-- 
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users