Plotting Trajectories
Mike German
I have to sets of latitude and longitude data. At the moment I have these data in four waves: LatStart,LngStart, LatEnd and LongEnd. The first set is the starting position and the second set are the end position of trajectories. How would I go about plotting on a scatter plot the indivual trajectories?
Hi,
Assuming you are interested only in a simple straight line trajectory. My approach would be to create a wave for each event, a 2x2.
The columns would be lat, and long, and row 0 would be start and row 1 would be end. You could the plot the wave as XY and the line you be the trajectory.
If you had a great number of these and want to keep them all in single wave, I would append the pair with a NaN set of values between them.
Does this get close to what you need?
Andy
October 27, 2021 at 07:21 am - Permalink
Yes Andy,
I have got the data into a 2x2 wave to the format you show. But how would I now display as Lat v Long ?
October 27, 2021 at 08:43 am - Permalink
Here is what I have if a have Display D1UmPos
October 27, 2021 at 08:58 am - Permalink
OK worked out how to do display
October 27, 2021 at 09:02 am - Permalink
In reply to Yes Andy, I have got the… by Mike German
Hi Mike,
One column should be longitude and the other latitude with the first point as start and the second as end.
For example, I set up a data table and note: I have added data labels (both rows and columns - this is extra credit but something I use often). If you don't have column labels select the column id for longitude for X (column 0 for example) and the latitude for y (column 1 for example)
In the graph set up I use the same wave for both x (longitude) and y (latitude). with the rows now the start and end points.
and graph set up
Andy
October 27, 2021 at 09:08 am - Permalink
Thank Andy
Here is my plot
October 27, 2021 at 09:19 am - Permalink
All I need now are the directional arrow :-)
October 27, 2021 at 09:20 am - Permalink
In reply to All I need now are the… by Mike German
Hi Mike,
Since you asked nicely.
I tweaked my data table to show effect.
Double click wave to bring up trace modify dialog. Select Mode to markers and then in markers pop select arrows.
Adjust arrows to your heart's content.
And Bam!
Also if you want to retain both markers and arrows, you might experiment with adding the traces twice, once with arrow markers the second with standard markers.
Andy
October 27, 2021 at 09:37 am - Permalink
What more could I ask for <shrug> ? .... thinks .... ;-)
Much Appreciated.
October 27, 2021 at 10:19 am - Permalink