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

Philipp Mühlmann p.muehlmann at gmail.com
Tue May 12 22:34:12 CEST 2015


Dear Tim and Samual,

this is hilarious :-).

There is a little thing to mention though.

The X-axis rotation can be performed only up to a number of times.

Now imagine an aircraft making one full right turn starting from 0° heading.

Than the X-axis is shifted through 1 time completely.

So if the aircraft would add another right turn the X-axis would not
move anymore.

NOte aswell that the heading does not have to start at 0 necessarily.

Of course one could set the boundaries to such values that they won't
be reached normally, such as:

// one turn = 360°

nr_of_possible_turns = 10^4 * 360

x = linspace(-nr_of_possible_turns,nr_of_possible_turns,nr_of_possible_turns/360);

But this might become impracticable.

I also started to rotate a polarplot but didn't come along yet.

The idea was to first create the polarplot and than rotate it
according to the data input.


heading = linspace(0,360,37);

drawlater();
polarplot();   // should maybe be edited and savede as polarplot3.sci

a = gca()

for i = 1:max(size(heading))

       a.rotation_angles = [90,heading(i)];
       drawnow()
end;

This seem to work, but there are some points to solve:

1st: rotation center of polarplot() is not at (0,0,0). Therfore the
complete plot is moving to the left and right.

2nd: All labels are visible at all time. Therfore labels will overlay
each other.
       A solution could be to have the label color the same as the
figure background and only labels beeing in the
       forground beeing a different colour. What 'I mean with
foreground one can see if you set

       a.rotation_angles = [80,heading(i)];

Attached you may find my draft scripts for the display, so you may get
a better impression of the idea.

- no 'polarplot' nor 'pmodulo' implemented yet

Best regards,
Philipp

2015-05-12 21:45 GMT+02:00 Samuel Gougeon <sgougeon at free.fr>:
> 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 pressed on the 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
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>



-- 
There we have the salad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_HeadAlt.sce
Type: application/octet-stream
Size: 682 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20150512/0e1da490/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HeadAlt.sci
Type: application/octet-stream
Size: 2509 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20150512/0e1da490/attachment-0001.obj>


More information about the users mailing list