LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D XY graph not connecting points

In creating a 2D XY graph, I've discovered that Plot Interpolation 4 did not connect some data points.  Plot Interpolations 0, 1, 2, 3 and 5 work correctly.

 

This behavior is not affected by Point Style, Line Style or Line Width.

 

This is what I see when I use Plot Interpolation 4:

 

Graph Issue

 

Any ideas?  I've attached the LV 2015 vi that shows the issue.

 

Thanks for any help!

 

Brian

 

 

 

 

 

 

0 Kudos
Message 1 of 9
(4,907 Views)

I played around with your VI for a bit, removing the express VI's and signal wires, generating a different X and Y values, placing a new X-Y chart.  All my changes still yielded the same artifact.

 

Very strange, I don't have a solution for you, however I will point out that its probably not a coincidence that the artifact appears on the 400th sample.

 

I also attached my simplified version of your VI which shows the same behavior.

 

0 Kudos
Message 2 of 9
(4,890 Views)

I took a look at your VI and was surprised to see that Plot Interpolation 5 had the same problem at the same point.

 

I went back to my VI and discovered the problem was there as well.  I guess I just remembered incorrectly when I posted.

 

Thanks for doing that simple test.  I'm happy to know I wasn't making a simple mistake!

 

Brian

0 Kudos
Message 3 of 9
(4,885 Views)
I can't look at the code from my phone, but does the data being plotted have a point the value of which is NaN? The definitely cause a break in a line.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(4,877 Views)

No, unfortunately it doesn't.  Thanks for the suggestion, however!

 

Brian

0 Kudos
Message 5 of 9
(4,874 Views)
What are the data point values?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 9
(4,870 Views)

Well, the VI posted by SigRob is actually better than mine to show the problem.

 

He simply uses a loop with N=1000 and x = y = DBL (i), creating a straight line.  The points for i=399 and i=400 are not connected.

 

Brian

0 Kudos
Message 7 of 9
(4,868 Views)

@mikeporter wrote:
What are the data point values?

I looked at the values in detail yesterday and while the two arrays have a NaN at the very end, these have nothing to do with the bug observed here. (even if we remove the NaN, the problem persists). I guess it is just a shortcoming in the implementation, maybe it does the interpolation in sections and fails to patch in-between. I have never found any reason to use any of these interpolations and I don't think they are very commonly used in general. It also has nothing to do with the huge difference between the x and y value ranges, e.g. if we scale X to bring them into a more normal range, the problem still shows.

 

These interpolations are typically used with fills, and the fill actually does not show a gap, so the problem is really minimal.

 

Note that in this case, the x values are equally spaced (except for a small glitch near index 320 where the value is 3600010000 instead of the expected 3600000000), so we can probably substitute a plain waveform graph. If we do that, the problem no longer appears. the problem is isolated to the xy graph. (And yes, I think it is a bug!)

 

See attached comparison. The problem occurs for interpolations 4 and 5.

 

 

 

0 Kudos
Message 8 of 9
(4,834 Views)

 

Thanks for taking a look at this, everyone!  I'm glad it wasn't something I was doing (or not).

 

Brian

0 Kudos
Message 9 of 9
(4,772 Views)