# What is the meaning of the Legend values for DensityHistogram and SmoothDensityHistogram? [closed]

I generate some random 2D data points, then look at the histogram in three different ways.

dataf = RandomVariate[NormalDistribution[0, 1], {200, 2}];

Histogram3D[dataf, 5]

DensityHistogram[dataf, ColorFunction -> "Rainbow", ImageSize -> 400,
AspectRatio -> 1/GoldenRatio, ColorFunction -> "Rainbow",
ImageSize -> 400, AspectRatio -> 1/GoldenRatio,
ChartLegends -> Placed[Automatic, Right]]

SmoothDensityHistogram[dataf, ColorFunction -> "Rainbow",
ImageSize -> 400, AspectRatio -> 1/GoldenRatio,
ColorFunction -> "Rainbow", ImageSize -> 400,
AspectRatio -> 1/GoldenRatio,
PlotLegends ->
Placed[BarLegend[Automatic,
LabelStyle -> {GrayLevel[0.3], 10, FontFamily -> "Helvetica"}],
After]]


The values along the z-axis for the Histogram3D are easy enough to understand, they are the bin heights. But what are the meanings for the values in the DensityHistogram legend? I would expect it to be related to the first plot like DensityPlot is related to Plot3D. But the values are wildly different.

And the SmoothDensityHistogram is even more different.

## closed as off-topic by m_goldberg, Brett Champion, MarcoB, user9660, dr.blochwaveNov 5 '15 at 16:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Brett Champion, MarcoB, dr.blochwave
If this question can be reworded to fit the rules in the help center, please edit the question.

• It is totally unclear what you asking. – m_goldberg Nov 5 '15 at 14:30
• The values for DensityHistogram and Histogram3D are the same, but you aren't using the same number of bins for both. – Brett Champion Nov 5 '15 at 15:11
• "SmoothDensityHistogram[data] by default generates colorized grayscale output of the PDF of {{$x_1$, $y_1$}, ...}, based on a smooth kernel density estimate." – Brett Champion Nov 5 '15 at 15:12