[Scilab-users] Equivalent of matlab area plot

Adrien Vogt-Schilb vogt at centre-cired.fr
Wed May 21 23:52:24 CEST 2014


On 21/05/2014 17:27, Adrien Vogt-Schilb wrote:
> Samuel, all
>   is there a way to display the axes and the ticks in the top of the shaded
> areas?
>
Sorry I was reacting to the following code:


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