[Scilab-users] vatying color along a curve

2013-03-01 Thread grivet

Hello,
I am trying to plot a curve using varying colors (or saturations) along 
the way. The curve is computed as a series of segments.
To plot a segment beginning at (xd,yd) and ending at (xf,yf), I have 
tried the following


plot([xd,xf],[yd,yf],foreground,3);

This works, but, at each call of plot (thousands in my case) Scilab 
emits the following message:


AVERTISSEMENT : Incorrect input : Color vector should be a 3x1 or 1x3 vector
Further, I would like to use colors which do not belong to the default 
color table. If I do


plot([xd,xf],[yd,yf],foreground,[3,3,3]);

the program stops on the first call to plot with the following error 
message:


addcolor : Type erroné de l'argument d'entrée n°1 : Une structure de 
données de type color_map attendue


I then tried

plot([xd,xf],[yd,yf],foreground,color_map(3));

the program stops on the first call to plot with the following error 
message:

Variable non définie : color_map

What is the correct syntax? I would like to choose a different color 
vector for each call of plot. Further, the help
sometimes states that color vector elements must be integers from 0 to 
256, sometimes reals between

0 and 1; which is correct ?

Thank you in advance for your time and help.
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] vatying color along a curve

2013-03-01 Thread Stanislav
Hi.
About colors see help color_list.
You can set your own color with help of name2rgb or provide color directly:

plot(cos(1:100),foreground,name2rgb('green')/255); 

or

plot(cos(1:100),foreground,[0.8 0.75 0.75]); // I don't know the name of
this color

Stanislav



--
View this message in context: 
http://mailinglists.scilab.org/Scilab-users-Format-legends-of-a-graph-as-a-2D-table-tp4025997p4026110.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users