<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello Raphael,<br>
<br>
Nice plot, but sadly it doesn't rescale.<br>
Do you have an idea how to make it fit the axes, to rescale
automatically?<br>
<br>
Yann<br>
<br>
<div class="moz-cite-prefix">Le 07/10/2015 00:17, Rafael Guera a
écrit :<br>
</div>
<blockquote
cite="mid:BLU436-SMTP20052F19EA9E25D4BF40C18CC370@phx.gbl"
type="cite">
<pre wrap="">Hello Antoine,
An attempt below, not particularly clean but I hope not too dirty either:
//INPUT
t = [ 0 2 5 10 12 17 20 30 35 45 60]'*0.1;
N = [20 18 15 14 12 9 6 4 3 2 1]';
t2=[];N2=[];
ns= length(t);
t2(1:2:2*ns) = t;
t2(2:2:2*ns) = [t(2:$)-%eps; t($)];
N2(1:2:2*ns-1) = N;
N2(2:2:2*ns) = N;
clf;
xfpoly([t2(1)-%eps;t2;t2($)+%eps],[0;N2;0]);
h = gce();
h.line_mode = "off";
h.background = color('gray');
plot(t2,N2,'black', t2,21*exp(-t2/2),'red');
Regards,
Rafael
-----Original Message-----
From: users [<a class="moz-txt-link-freetext" href="mailto:users-bounces@lists.scilab.org">mailto:users-bounces@lists.scilab.org</a>] On Behalf Of Antoine Monmayrant
Sent: Tuesday, October 06, 2015 10:57 AM
To: Users mailing list for Scilab <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.scilab.org"><users@lists.scilab.org></a>
Subject: Re: [Scilab-users] How to produce a filled staircase plot
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 occur 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 < <a class="moz-txt-link-rfc2396E" href="mailto:Serge.Steer@inria.fr"><mailto:Serge.Steer@inria.fr></a> <a class="moz-txt-link-abbreviated" href="mailto:Serge.Steer@inria.fr">Serge.Steer@inria.fr</a>> a écrit:
</pre>
<blockquote type="cite">
<pre wrap="">Le 06/10/2015 00:01, Antoine Monmayrant a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">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
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.scilab.org"><mailto:users@lists.scilab.org></a> <a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-rfc2396E" href="http://lists.scilab.org/mailman/listinfo/users"><http://lists.scilab.org/mailman/listinfo/users></a> <a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre wrap="">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
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.scilab.org"><mailto:users@lists.scilab.org></a> <a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-rfc2396E" href="http://lists.scilab.org/mailman/listinfo/users"><http://lists.scilab.org/mailman/listinfo/users></a> <a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>