[scilab-Users] Equivalent of matlab area plot

Ruben Bibas ruben.bibas at gmail.com
Sun Jan 23 10:26:06 CET 2011


Thank you very much for your helpful answers !
Cheers
Ruben

On Fri, Jan 21, 2011 at 3:44 PM, Samuel GOUGEON
<Samuel.Gougeon at univ-lemans.fr> wrote:
>  Hello,
>
> ----- Message d'origine -----
> De : Ruben Bibas
> Date : 21/01/2011 13:44:
>>
>> Hi everyone,
>>
>> I am currently trying to convert my matlab code to Scilab that was area
>> plots.
>> Is there an equivalent in Scilab?
>>  Any comments are appreciated, even just suggestions or websites that
>> can help are also appreciated.
>>
>> Thank you
>
> Herebelow  is an example with any number of curves.
> Cheers
> Samuel
> --------------
> // area()
>
> y = [1  5  3;  // Data
>     3  2  7;
>     1  5  3;
>     2  6  1];
>
> [nL, nC] = size(y);
> x=[ 1 1:nL nL];
> base = min(y)-1;              // Base level
> bottom = ones(1,nC)*base;     // proper bottom closure
> clf, plot2d(x,[ bottom ; flipdim(cumsum(y,"c"),2) ; bottom])
> e = gce(); areas = e.children;  // iD of the set of curves
> areas(:).polyline_style=5;      // switching to filled mode
>
> for i=1:nC, areas(i).foreground = color(255*i/nC,0,0); end // recoloring
> according to any wish
>
>



More information about the users mailing list