[Math] the correct way to plot histogram

graphing-functionsstatistics

When we plot the frequency histogram, the frequency is equal to the area of the bar or the height of the bar?
Is $\text{height} = \frac{\text{frequency}}{\text{size of the class}}$ ? If so, then how to label the vertical axis?

For example, based on the following data,

Class   Frequency
[0,9)      10
[10,19)    20
[20,39)    40

Then what is the label for vertical axis? Is it "frequency" or "frequency density"? The height of first class is 10 or 1.0? For the 3rd class, is it 20, 2.0, or 40?

Possible solution (or answer)
Based on the information I studied from several links,
when the width of the class is different, one needs to use "Frequency density" for the vertical axis. Then, $\text{frequency} = \text{height} \times \text{width of the class}$

If the class are in the same width, then one can use "Frequency" for the vertical axis, then all the heights of the bars are point to the value directly.

Best Answer

Do it in such a way that the area of each box is proportional to the number of data points, or to the probability (depending on what kind of histogram it is).

The units on the vertical axis should be the reciprocal of the units on the horizontal axis, since when you multiply them to get probability, it needs to be dimensionless. For example, if $x$ is in inches, $y$ is in units per inch or percent per inch.