LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bad zero in y-axis

I am running LabVIEW version 8.01. I am plotting very small amplitude data on an xy plot. The y-axis is labelled as follows

            5E-14
         2.5E-14
-6.31089E-30
        -2.5E-14
           -5E-14
         -7.5E-14

That is to say, LabVIEW is using -6.31089E-30 instead of 0. This only happens occassionally and I can't figure out what causes it. Has any one else seen this? Have any clues how to make it stop?
0 Kudos
Message 1 of 5
(2,747 Views)
Yeah, that is annoying. I've seen it happen from time to time as well. You didn't mention where your data is coming from, but it even happens if you explicitly give it a value of zero:



The cursor gives the correct value, but the scale values are calculated, so when you're dealing with numbers that small you get numerical issues because of the way floats have to be stored and calculated upon in computer memory. One thing you can try is to scale your numbers before feeding them to the plot. Thus, scale all your Y values by 1E14, then set your Y-scale label to indicate the values are " x 1E-14"

It even happens with a picture plot:




Message Edited by smercurio_fc on 06-30-2008 01:55 PM
Download All
0 Kudos
Message 2 of 5
(2,738 Views)


@smercurio_fc wrote:
Yeah, that is annoying. I've seen it happen from time to time as well. You didn't mention where your data is coming from, but it even happens if you explicitly give it a value of zero:
....
It even happens with a picture plot:


Message Edited by smercurio_fc on 06-30-2008 01:55 PM

And that is where the answer lies:
Num To Text.vi is the one calculating the points on your axis (together with it's callers: Cals Scale Specs.vi and Calc Increment.vi).
Diving into the Picture Plots VIs is worth doing.

Ton ( I don't think changing these VIs will alter your plots though)


Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 5
(2,727 Views)

 Diving into the Picture Plots VIs is worth doing.

In my line of work I don't deal with graphs that much so I've never dug around there, although those VIs are quite good at showing you just a small sample of what you can do with pictures..

I was presenting the picture plot to indicate an equivalent behavior. Looking at the VIs that you mentioned, though it seems like the underlying issue is really the numerical issue of calculating with such small numbers. I think the best bet, though, is to scale the numbers. When I scaled the example numbers by 1E14 I got a 0 right where I expected.
0 Kudos
Message 4 of 5
(2,724 Views)
Thanks for the help. "Annoying" is the appropriate adjective and I just wanted to see if there was a trick out there that I wasn't aware of. This plot is one of four plots comparing acquired and calculated transients. In this case the small numbers come about because we are looking at the difference between two signals that are almost equal.

The four plots all have the same domain. With 0 on that y-axis, the four plots line up nicely. Without it, they don't because the corresponding x-axis gets shortened to make room for -6.31089E-30 on the y-axis. But, since the "14" part of "5E-14" is the thing that I am most interested in, I am only mildly annoyed that the x-axis don't line up.  So this is a case of "Gee, it would be nice if..."

Honestly, I just figured that if I put the problem in the public domain, it might become someone else's problem and get fixed some day.
0 Kudos
Message 5 of 5
(2,696 Views)