[Scilab-users] plot(x) - define color

P M p.muehlmann at gmail.com
Fri Feb 19 15:16:15 CET 2021


..because the question also mentions the line style:

in addition to:

    colour=["red","blue","chocolate1",...]; // help color_list

you can also create

    lineStyle = [ 1, 2, 3, 4, 2, 1 , ......]  // help polyline

and do:


for j=1:20
   h = plot(TestPH(j,:))
   h.foreground=color(colour(j));
   h.line_style = lineStyle(j)
end

BR
Philipp






Am Fr., 19. Feb. 2021 um 10:53 Uhr schrieb Stéphane Mottelet <
stephane.mottelet at utc.fr>:

> Hi,
>
> Since 6.1 version, plot() yields the handles of created polyline
> entities, allowing to improve the piece of code which has been proposed,
> like this:
>
> colour=["red","blue","chocolate1",...]; // help color_list
> for j=1:20
>    h = plot(TestPH(j,:))
>    h.foreground=color(colour(j));
> end
>
> S.
>
> Le 19/02/2021 à 10:37, Jean-Yves Baudais a écrit :
> > Hi,
> >
> >
> >>
> colour=['.r-','.g-','.k-','.b-','.m-','.r:','.g:','.k:','.b:','.m:','.r--','.g--','.k--','.b--','.m--','.r-.','.g-.','.k-.','.b-.','.m-.'];
> >> for j=1:20
> >>     plot(TestPH(j,:),colour(j));
> >> end
> >>
> >> but the plot is not very clear. I would like to add different color and
> to
> >> reduce line styles, that are difficult to recognize in the plot.
> >
> > I don't if there is a dedicated function, but
> >
> > colour=["red","blue","chocolate1",...]; // help color_list
> > for j=1:20
> >    plot(TestPH(j,:))
> >    gcf().children.children.children(1).foreground=color(colour(j));
> > end
> >
> > gives a solution.
> >
> > --Jean-Yves
> > _______________________________________________
> > users mailing list
> > users at lists.scilab.org
> >
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
>
> --
> Stéphane Mottelet
> Ingénieur de recherche
> EA 4297 Transformations Intégrées de la Matière Renouvelable
> Département Génie des Procédés Industriels
> Sorbonne Universités - Université de Technologie de Compiègne
> CS 60319, 60203 Compiègne cedex
> Tel : +33(0)344234688
> http://www.utc.fr/~mottelet
>
> _______________________________________________
> 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/20210219/45f21221/attachment.htm>


More information about the users mailing list