[Scilab-users] vatying color along a curve

Serge Steer Serge.Steer at inria.fr
Fri Mar 1 16:00:59 CET 2013


Le 01/03/2013 14:47, grivet a écrit :
> 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);
>
It is better to use the xsegs function to do that. This function allows 
to draw a set of colored segments using a single command

> 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 at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>




More information about the users mailing list