# why does y axis sometimes change from normal histogram to kernel density?

Consider the distributions I have plotted below. They are of the same variables, one in normal histogram form and another in kernel density (Epachanov).

As far as I know, the auc of the kernel curves is 1, so I'm not sure why the y-axis would need to change sometimes for that. Yeah, the main thing is I'm not sure why sometimes the y axis is the same and sometimes the y axis is different.

## Question

Why did the y axis remain the same for the left two (0 to .8) but changed for the right two (histogram is 0 to 14, kernel is 1 to 7)? Feel free to explain about how the y axis factors into interpretation if you don't mind.

For the LHS plots, the areas under the curves are n near $$1$$, so you don't see a range change in y-axis. We can inspect it visually, by reading $$y$$ values for each bin, and multiplying it with the step size, $$0.25$$ for the blue histogram. For example, the it has an approximate area of $$(1/3\times3+1+2+3+3.5+5+7\times2+3.5+1+1.5)/10\times 0.25\approx 0.91$$ This is my simple approximation, you can come up with another, or directly calculate it from the data. But, it'll be around $$1$$. The situation is similar with the red histogram. KDE is not the same as normalized histogram but for simplicity you can think like we normalize the curve with 1/AUC. If AUC is close to $$1$$, then normalization won't affect the value on the y-axis a lot.
It's harder to do visual inspection for the red plot on RHS, however, clearly, the AUC won't be close to $$1$$ so that the resulting KDE curve's y-axis values will be in different range. Also, some jumps might not well represented in KDE smoothed PDF. And, for the blue curve in RHS, y-axis range didn't change significantly. In the histogram, most of the values fluctuate around $$1$$, and the AUC is therefore $$1$$ since the support spans $$[0,1]$$. The KDE also produces a curve with y-value near $$1$$.