From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Directional arrows in XY graph

I use an XY graph to plot test data which is synchronized and resampled to align.  The resulting plots usually look something like this:

 

1.png

 

What I would like to do is add little directional arrows indicating the time order of plotting.  This is useful for analysis since the plots represent hysteresis in my test system.  The order in which the system is exercised determines some aspects of the hysteresis effect.  So I usually have to plot out the time based plots of each of the XY graph inputs.  If I could add directionality onto the above plot, I could avoid needing to do that.  So, is there any way to do this with the built in LV XY plot to make it look something like this?

 

2.png  

 

I was contemplating using annotation arrows, but haven't yet experimented to see if that was possible.

 

Thanks,

 

XL600

0 Kudos
Message 1 of 7
(3,906 Views)

Easiest would be to just make a second plot with data consisting of 3 point separated by a NaN (each three points are the "end-tip-end" positions of each arrow). Another option would be to use image function and the "plot images" tool.

0 Kudos
Message 2 of 7
(3,875 Views)

Hmm, I’d have to come up with a way to determine the rough vector so the ends would be symmetric about the data.  Determining the point is easy enough... just place 20 or so along the data length, evenly spaced.

0 Kudos
Message 3 of 7
(3,871 Views)

Well, if you do the xy graph using complex, you can get the local direction from any two adjacent points. Here's a quick draft. Very rough, I'm sure it needs a few tweaks.

 

Arrows.png

Message 4 of 7
(3,865 Views)

That is simply awesome Smiley Happy

 

The data I’m using is a bit noisy (X and Y are coming from analog sensors) so adjacent points wouldn’t work.  I’ll have to take small segments and generate a line fit.  But the idea looks like it’ll work great.  I can’t wait to get into work to try it (don’t have LV at home Smiley Sad).

 

thanks for the idea!

 

 

0 Kudos
Message 5 of 7
(3,861 Views)

Here's an approach using annotations.  I thought this might work, but LV doesn't provide very much in the way of programmatic control over the annotation (EX: Line width).  I had to use events to redraw the arrows due to the way the label position offsets are handles when zooming.

 

Honestly, the overlay plot with NaN seems like it would work better because of the limitations of programmatic annotation control.

 

Arrows.png

0 Kudos
Message 6 of 7
(3,812 Views)

Thumb Up  👍. I did not know xy-Graph can use complex data.

0 Kudos
Message 7 of 7
(608 Views)