# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Plot a color point on a XY graph

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.

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.

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

Message 1 of 5
(5,166 Views)
Solution
Accepted by oodan123

## Re: Plot a color point on a XY graph

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

Message 2 of 5
(5,151 Views)
Solution
Accepted by oodan123

## Re: Plot a color point on a XY graph

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

Ian

Message 3 of 5
(5,148 Views)

## Re: Plot a color point on a XY graph

@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

Message 4 of 5
(5,146 Views)

## Re: Plot a color point on a XY graph

Thanks, that's exactly what I was after

Message 5 of 5
(5,140 Views)