03-16-2015 03:03 PM
Hello everyone,
I am trying to get my bars via the Histogram.vi to line up with my X-axis. I have placed three elements in a 1D array of doubles. I have tried for the last three hours to get this right and it is driving me nuts!
Can someone help?
Thanks,
Eric
Solved! Go to Solution.
03-16-2015 03:57 PM
If you would use the general histogram, you would have more flexibility. At least wire a larger value to the "intervals" input (currently 10).
03-16-2015 04:00 PM
This is what the help file says:
The histogram is a frequency count of the number of times that a specified interval occurs in the input sequence. The width of the frequency bin is
delta_x = (max–min)/m
where m is the requested number of bins. The centers of each bin are set according to the following equation:
center[i] = min + delta_x/2 + i * delta_x.
With double numbers it gets difficult to solve, you need to offset the min value and adjust for the other X values to be centered. If you can live with it a (far from perfect) workaround is to use a large amount of bins (like 200). This way the bars will look centered even if not exactly.
Ben64
03-17-2015 01:15 PM
ben - I believe your "far from perfect" workaround will work for what I need. Thank you.