[Scilab-users] Same color for contour isolines

Samuel Gougeon sgougeon at free.fr
Sat Mar 18 17:14:52 CET 2017


Hello Jens,

Le 16/03/2017 à 11:32, Jens Simon Strom a écrit :
> Hi,
> How would you avoid the loop in the following example?
>
> n2_=-1000:200:1000;
> nS_=-1000:200:1000;
> [N2,NS]=ndgrid(n2_,nS_);
> N1=2.6*N2+(3.6)*NS;
> xdel();
> contour(n2_,nS_,N1/100,[-60:10:60])
>
> ca=gca();  Comp=ca.children;  //colum matrix of handles: (Compound)
> nComp=length(Comp);
> for  k=1:nComp
>   Comp(k).children.foreground=3;     
> end

This code also changes the color of the frame of text labels (if it was 
displayed).

The ideal expected way would be:
ca.children.children(2:2:$).foreground = color("green");

But this instruction yields an error. This is a bug, just reported here:
http://bugzilla.scilab.org/15079
The proposed solution shall be available in Scilab 6.0.1.

Before it, you may simply do the following:

edit %h_get
// in the file, replace the instruction
out_vect=[out_vect,get(hdl(i),str)]
// with
out_vect=[out_vect;get(hdl(i),str)]

Then exec %h_get.sci
If you want to have it fixed permanently before the 6.0.1 release, you 
must recompile the graphics library:

cd SCI/modules/graphics/macros
predef clear
genlib graphicslib
clear %h_get

and that's all for ever: Then the syntaxes
ca.children.children(2:2:$).foreground // reading values = extraction
ca.children.children(2:2:$).foreground = color("green"); // setting 
value = insertion
will work even after restarting Scilab

HTH
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170318/8990990a/attachment.htm>


More information about the users mailing list