[scilab-Users] How to replace Matlab stairs function in Scilab

Mathieu Dubois mathieu.dubois at limsi.fr
Thu Mar 12 14:49:45 CET 2009


Hi David,
> Thank you Mathieu, "plot2d2" seems to be the answer. 
>   
Glad to help you.
> At least it support most parameters of the Matlab pendent in some way
> Another way I just discovered is using "plot2d" in combination with setting
> the polyline settings:
>
> handle = get("hdl");
> handle.children(1).polyline_style = 2;
>   
This is essentially what plot2d2 does. Extract from the doc:

Note that all the modes proposed by plot2dxx (xx = 1 to 4) can be enabled using plot2d
and setting the polyline_style option to the corresponding number.

So the options to plot2d2 are the options to plot2d... And the way you 
discovered is as valid as plot2d2.

For your example you could try:

--> plot2d2(rec(:,2), rec(:,1),leg='TAG0 Receiver')  // leg is for legend

I don't understand what the parent property is.

Regards,
Mathieu
>   
>> -----Original Message-----
>> From: Mathieu Dubois [mailto:mathieu.dubois at limsi.fr]
>> Sent: Mittwoch, 11. März 2009 21:34
>> To: users at lists.scilab.org
>> Subject: Re: [scilab-Users] How to replace Matlab stairs function in
>> Scilab
>>
>> Hi David,
>>
>>     
>>> I just started to use Scilab and I'm struggling a little bit as I
>>>       
>> have to
>>     
>>> convert some of my scripts from Matlab to Scilab.
>>>
>>> Is there any equivalent to Matlab "stairs" function or any suitable
>>>       
>> way to
>>     
>>> draw staircase like steps?
>>>
>>>       
>> If I understand correctly matlab's stairs function
>> (http://www.math.carleton.ca/old/help/matlab/MathWorks_R13Doc/techdoc/r
>> ef/stairs.html)
>> you should use plot2d2.
>>
>> Try:
>> --> x = 0:.25:10;
>> --> plot2d2(x,sin(x));
>>
>> BTW I have found this very simply: type 'step' in the 'search' tab of
>> scilab's help.
>>
>> Technically speaking plot2d2 is just a plot2d with a special
>> polyline_style (see help :).
>>
>>     
>>> In particular, I would like to have something similar to:
>>>
>>> 	stairs(rec(:,2),rec(:,1),'DisplayName','TAG0
>>> Receiver','Parent',axes1);
>>>
>>>       
>> I don't know exactly what these options are supposed to do (I don't
>> have
>> matlab) but you should be able to find out the right options to
>> plot2d2.
>>
>> Hope that helps (if it's still needed),
>> Mathieu
>>     
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20090312/2ec4f54d/attachment.htm>


More information about the users mailing list