[scilab-Users] Re: Re: plotting two y-axes, lines and bars in one plot

Eric Dubois grocer.toolbox at gmail.com
Sun Aug 31 20:10:13 CEST 2008


As promised, here is a function pltseries0 that allow inverted axes, along
with new function pltseries and drawy, in the joined zip file

I have added an option 'reverse=vec' where vec is a (2x1) vector of 0 and 1
indiating how the axis must be drawn (0: normal order; A: reverse  order).

For instance:
mat = [0, 1, 40;  1, 2, 30; 2,3,20; 3,4,10];
pltseries0([mat(:,2),
mat(:,3)],[],'example',string(
>
> mat(:,1)),1,"yaxis=[1 2]", "bars=[0 1]",'reverse[0 1]')


The trick is either to take the opposite of the series and use drawaxis with
the option val=string(-s) where s is the axis corresponding to the inverted
series or to attack the handle, and to note that the second axis is the last
of the children and to modify the filed axis_labels.

Eric.

2008/8/29 Eric Dubois <grocer.toolbox at gmail.com>

> Thanks!
>
> I will have a look this w/e to see if it is possible to have inverted
> selected axes. A priori I would have done like you...
>
> Eric.
>
> 2008/8/29, Simon <simon.elfert at web.de>:
>
>> alright, that works pretty nice! A very fine tool.
>>
>> Is it possible to have the right y-axis at normal scale, but the left
>> y-axis with a reverse scale (with >> h=gca(); h.axes_reverse = ["off",
>> "on", "off"]; << I only get control of both y-axes at a time.
>>
>> greetings,
>> Simon
>>
>>
>>
>>
>> ps: For anyone who concerns... this works fine:
>>
>> mat = [0, 1, 40;  1, 2, 30; 2,3,20; 3,4,10];
>> pltseries0([mat(:,2),
>> mat(:,3)],[],'example',string(mat(:,1)),1,"yaxis=[1 2]", "bars=[0 1]")
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20080831/5f89178d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pltg_new.zip
Type: application/zip
Size: 6071 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20080831/5f89178d/attachment.zip>


More information about the users mailing list