[Scilab-users] periodical X-Axis in 2d plot

Samuel Gougeon sgougeon at free.fr
Tue May 12 21:45:15 CEST 2015


Hi Philipp,

Here is an example:

x  =  linspace(0,1000,400);
y  =  sind(x).^2-cosd(3*x)/2;
clf
plot(x,y)
a  =  gca();
xt  =  0:30:1000;
a.x_ticks  =  tlist(["ticks"  "locations"  "labels"],xt,string(pmodulo(xt,360)));
a.zoom_box  =  a.data_bounds';
a.zoom_box([1  3])  =  [0  270];
a.sub_ticks(1)  =  5;

// Then, on the plot, pan the view (clic and keep pressedonthe graphical area, drag the view left<-> right, and look at the slidding x axis)
Setting explicitely labels cancels the autoticking feature (even when resizing the figure).

Best regards
Samuel

Le 12/05/2015 06:55, Philipp Mühlmann a écrit :
> Dear all,
>
> for a display I'l like to have the heading at the x-axis and the
> altitude at the y-axis.
>
> The display will show a cross made of two xpoly lines.
>
> Both axes will change accordingly to the data input, which results
> that the cross will stay in the midle of the display.
>
> This means: axes data bounds are changing.
>
> Now the question:
>
> Since the heading can be only between 0 and 360°, how is it possible
> to have the x-axis build in such a way, that it shows 270° <---0--> 90
> °, when the heading value is 0?.
>
> Is it possible to achieve this by using two x-axes?
>
> The same would be if one reaches values heading >270°...then from the
> right side 0° and later on 45° as a tick should slide into the display
> instead of 360° and 405°.
>
> Best regards,
> Philipp
>

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


More information about the users mailing list