1
$\begingroup$

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]]

enter image description here

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.

$\endgroup$

closed as off-topic by m_goldberg, Brett Champion, MarcoB, user9660, dr.blochwave Nov 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.

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

Browse other questions tagged or ask your own question.