[Scilab-users] How to produce a filled staircase plot

Antoine Monmayrant amonmayr at laas.fr
Tue Oct 6 11:57:23 CEST 2015


Thank you Serge for this solution, but it does not work for me: the "bars" in my case are not regular.
I am simulating an exponential random decay: starting from a number N0, my population decreases by jumps of N0->N0-1 that occure at random times, following an exponential law (see the attached plot).
For the moment, I just build my polygon by hand, but it adds quite a lot of "noise" on top of the code that I intent to show to my students.
I was hoping for a cleaner solution.

Thanks anyway,

Cheers,

Antoine

 
Le Mardi 6 Octobre 2015 11:42 CEST, Serge Steer <Serge.Steer at inria.fr> a écrit: 
 
> Le 06/10/2015 00:01, Antoine Monmayrant a écrit :
> > Hi everyone,
> >
> > I'm trying to do a filled staircase plot (ie a staircase where the area between the staircase and the x axis is filled with a solid color).
> > Is there a given combination of polyline_style and fill_mode, etc ... that can do this?
> > Or should I resort to building a polygon by hand?
> >
> > Thanks in advance,
> >
> > Antoine
> >
> > _______________________________________________
> > users mailing list
> > users at lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
> >
> May be the bar mode can help you
> x=linspace(0,%pi,10);y=sin(x);
> clf;plot(x,y);e=gce();e=e.children;
> e.polyline_style=6;e.bar_width=0.5;
> e.background=2;
> e.line_mode="off";
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 
 
 
 
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: decay.png
Type: image/png
Size: 15722 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20151006/30d657a4/attachment.png>


More information about the users mailing list