取消
显示结果 
搜索替代 
您的意思是: 

Bars not lining up correctly on Histogram.vi

已解决!
转到解答

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

0 项奖励
1 条消息(共 4 条)
3,073 次查看

If you would use the general histogram, you would have more flexibility. At least wire a larger value to the "intervals" input (currently 10).

0 项奖励
2 条消息(共 4 条)
3,052 次查看
解答
已被主题作者 Eric1977 接受

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

0 项奖励
3 条消息(共 4 条)
3,046 次查看

ben -  I believe your "far from perfect" workaround will work for what I need. Thank you.

0 项奖励
4 条消息(共 4 条)
3,000 次查看