LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why is my log plot rounding to integers?

I am writing a little curve fitting utility to post-process some data. The user inputs a file, part of which is turned into a histogram, and then the user identifies peaks on the graph and Labview fits and plots a gaussian at each identified peak. For some reason, the log plot output seems to be rounding to integers, which leads to ugly blocky graphs, as you can see if you run the .vi as described below.

 

 

Can someone tell me why this is happening, and how I can smooth things out so that it doesn't look like crap? The .vi is attached as well as the sub-vi used for the fitting and an example data file that it can be run on.

To get the example plot:

Run the .vi and feed it the .csv file
enter "3" when prompted about how many peaks there are
click on the graph at the 3 peak locations (roughly (0,20), (1200,8) and (1500,3))

0 Kudos
Message 1 of 3
(2,537 Views)

Where is "single gaussian peak.vi"?

 

BS

0 Kudos
Message 2 of 3
(2,479 Views)

woops, forgot to include that one. It is attached. I found the problem, though. Casting the output of the General_Histogram.vi to double fixed the problem. Apparently if you wire integers into the fitting program it outputs a rounded fit, for some reason. Seems like a bad choice of default behavior, since it involves a loss of precision...

0 Kudos
Message 3 of 3
(2,471 Views)