LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot a color point on a XY graph

Solved!
Go to solution

Hello, 

I currently have an XY graph plotting data from my LIDAR, which is just an array of complex numbers (i.e magnitude and direction). This is shown below.

Capture.PNG

As you can probably see from the image; my VI also detects corners, which in this case is around 500mm in front of the LIDAR and 22mm across. What I am hoping to do is to somehow plot a dot or a cross or something at the CornerX and CornerY position, something like the picture below. 

Capture.PNG

Is there an easy way to do this? Any help would be greatly appreciated. 

0 Kudos
Message 1 of 5
(5,163 Views)
Solution
Accepted by topic author oodan123

Yes.  You can plot multiple "plots" on an XY Graph.  A "feature" of XY plots is that all of the plots must have the same number of data points.  Here's what you can do:

  • Create your original line plot (what is shown on your Graph as "Plot 0".
  • Create a copy of the data.  Combine the two Arrays (using Build Array) and wire this to your plot.  Plot 1 will, of course, sit "on top of" Plot 0.  Change the properties of Plot 1 so that instead of a line plot, it is a plot of (big) Red Dots.
  • Now all you have to do is make all but one of the dots "disappear" from the Plot.  Let's say you know that Point 234 is the one you want to plot as a Big Red Dot.  In your Plot 1 array, set the Y Value of all the other points to the (Dbl) value "NaN", Not a Number, which will not show up on the plot.
  • You now should see Plot 0, the Line Plot, and Plot 1, a single Red Dot at Point 234 (the only point that does not have Y = NaN).
  • Note that this same trick will work if you have a Waveform instead of an XY Graph.

Try it, and if it works, come back here and mark this response as a Solution.

 

Bob Schor

0 Kudos
Message 2 of 5
(5,148 Views)
Solution
Accepted by topic author oodan123

This should do it. Make sure to adjust the plot style for plot 1 to have dots and no lines.

 

XY.PNG

Ian
LabVIEW since 2012
0 Kudos
Message 3 of 5
(5,145 Views)

@Bob_Schor wrote:

 A "feature" of XY plots is that all of the plots must have the same number of data points.  

I don't think this is correct, that is why you need to have array of cluster of arrays, rather than just a 2D array.

Ian
LabVIEW since 2012
0 Kudos
Message 4 of 5
(5,143 Views)

Thanks, that's exactly what I was after

0 Kudos
Message 5 of 5
(5,137 Views)