# 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.

• It is totally unclear what you asking. Nov 5, 2015 at 14:30
• The values for DensityHistogram and Histogram3D are the same, but you aren't using the same number of bins for both. Nov 5, 2015 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." Nov 5, 2015 at 15:12