[Scilab-users] Fwd: plotxxyyy
Frieder Nikolaisen
Frieder.Nikolaisen at student.hs-rm.de
Sun Oct 9 01:04:25 CEST 2016
Dear Philipp,
thank you, thats great. I will try it at work on monday. Actually, I do
have three plots sharing a common x axis and having three different y
axis. Why I do want to have two x axis is, to show to different times on
x. Once in secound, once in line of document.
Best regards
Frieder
Am 08.10.2016 um 23:43 schrieb Philipp Mühlmann:
> Dear Frieder,
>
> I understand following:
>
> You want to plot 3 graphs into one diagram.
>
> Basically each graph has it's own x and y axis.
>
> Since for two graphs the x-axis are the same, you want to have a
> diagram with two x-axis and three y-axis
>
> Please find a code snipplet that will create such a diagram.
>
> Best regards,
> Philipp
> clc();
> clear('all');
>
> x1 = linspace(1,10,10);
> x2 = linspace(0,100,101);
> x3 = x1;
>
> y1 = linspace(1,10,10);
> y2 = sin(x2);
> y3 = sqrt(x1);
>
> drawlater()
>
> plot2d(x1, y1);
> a1 = gca();
> a1.x_location = "bottom";
> a1.y_location = "left";
> a1.margins = [0.2,0.2,0.2,0.2]
>
> // Axis y2
>
> a2=newaxes();
> c=color("blue");
> plot2d(x2,y2,style = c);
> a2.font_color=c;
> a2.foreground=c;
>
> a2.filled="off";
> a2.x_location="bottom";
> a2.y_location="right";
> a2.margins = [0.2,0.2,0.2,0.1]; // shift axis relative to graphic window
> a2.data_bounds = [0,-2.;100,2]; // change axis bounds, so that graph is nicely placed in plotted area
>
> // Axis y3
>
> a3=newaxes();
> c=color("red");
> plot2d(x3,y3,style = c);
> a3.font_color=c;
> a3.foreground=c;
> a3.filled="off";
> a3.x_location="bottom";
> a3.y_location="left";
>
> a3.data_bounds = [0,1;10,4];
> a3.margins = [0.134 0.2 0.2 0.2];
>
> // display x3 to check overlapping of x1 and x3 tics;
> // if overlapping is good enough, than hide x3
> a3.axes_visible(1)="off";
>
> drawnow()
>
>
>
>
>
>
>
>
> 2016-10-06 21:28 GMT+02:00 Jens Simon Strom <j.s.strom at hslmg.de
> <mailto:j.s.strom at hslmg.de>>:
>
> *Edit in #3*
> Am 06.10.2016 18:20, schrieb Jens Simon Strom:
>> Hallo Frieder,
>> You ask many questions in one post.
>>
>> 1: You just divide the (numerical) time interval into an
>> adequate number of points (which can be neatly accommodated) with
>> linspace or ':' and plot the corresponding time text colums via a
>> for-loop. There is no need that 'text times' coincide with
>> measured data. They only should be placed at the correct locations.
>>
>> 3:You may not be familiar with how to get quick help from Scilab:
>> Just highlight the command 'plot2d' or 'style' here and go to the
>> help pages*by right mouse click.*
>>
>> 4: Highlight newaxes, foreground
>>
>> 5: I would postpone integrating a checkbox until everything else
>> is to your satisfaction. The rest of #5 is perhaps answered by #1.
>>
>> General remarks
>>
>> * Do not ask many questions simultaneously. Attack them one by
>> one. You make it easier for yourself and the helpers.
>> * Accompany your questions by short examples which omit
>> irrelevant 'ornaments'. The code you really write with the
>> variables you really use is less appropriate in most cases.
>> * Begin to polish the results (color, line types, fonts,
>> fontsize, etc.) only as the last step in your work. At the
>> beginning accept what Scilab delivers to you.
>> * Work the help pages.
>>
>> My painful experience is that the polishing job often consumes
>> more time (and nerves) than the technical problem itself. Scilab
>> is far from intuitive in that respect.
>>
>> Kind regards, Jens
>>
>>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org <mailto:users at lists.scilab.org>
> http://lists.scilab.org/mailman/listinfo/users
> <http://lists.scilab.org/mailman/listinfo/users>
>
>
>
>
> --
> In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.
>
> There we have the salad.
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161009/9f93f81b/attachment.htm>
More information about the users
mailing list