LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

histogram and bin centers

Hello everyone! 

 

I just started using LabView and have a question regarding the histogram VI. I have one assignment problem to complete, and I am practically done, except this one thing that's bugging me.

Basically, we flip four coins for a specific number of times and calculate the number of heads that are flipped each time. Then, we generate a histogram from that data. Now, notice the Bin center value array and the waveform graph don't match regarding the bin centers. Could somebody explain to me what did I do wrong here, and suggest some steps in correcting it? I want the bar centers to be at the values of the bin centers array (0,4  1,2  2  2,8  3,6).

 

Thank you,

Ivan

 

 

0 Kudos
Message 1 of 7
(4,037 Views)

Not sure if this is what you want, but click on the plot legend and choose what bar plot you want.

Snap5.png

 

You should also change your Total Number of Trials to an I32 number.

 

mcduff

 

 

0 Kudos
Message 2 of 7
(4,029 Views)

Thank you for your response.

 

You see, no matter what kind of bar plot I choose, the centers of the bars are at numbers 0, 1, 2, 3 and 4 on the graph, but the values of x output of the histogram VI reports that the centers of the bars are at 0.4, 1.2, 2, 2.8 and 3.6. I want to figure out how to harmonize the graph with the histogram VI output.

0 Kudos
Message 3 of 7
(4,017 Views)

Did you read the help for the function? It gives you the formula for determining the center.

 

mcduff

0 Kudos
Message 4 of 7
(3,990 Views)

I understand that. What i dont understand is how to calibrate the waveform graph and make the centers of the bars at point specified by the X values output of the histogram VI. Let me show you what i mean. The current graph looks like this:

Capture.PNG

I want it to look like this:

dqw.png

 

Thank you for your time,

Ivan

0 Kudos
Message 5 of 7
(3,981 Views)

Hi lvek,

 

check.png

You want something like this?

You need to set the x axis scaling as needed…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,975 Views)

Thank you. I had to simply create an indicator at the output of the histogram VI, instead of creating a waveform graph. That way, the x values are in place.

0 Kudos
Message 7 of 7
(3,967 Views)