3

I'm just using Histogram[data, 50]. All the examples on the Histogram help page show show the number of elements when the cursor hovers over each bin. I've tried to use Tooltip but it just shows 50 (the number of bins) for every bin.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
user5091
  • 191
  • 5
  • Possible duplicate http://mathematica.stackexchange.com/questions/51075/how-to-add-more-than-one-label-to-histogram-automatically http://mathematica.stackexchange.com/questions/50991/how-to-place-more-than-one-chartlabel-in-a-barchart – Basheer Algohi Feb 24 '15 at 05:43

2 Answers2

4

LabelingFunction is your friend, see here:

Histogram[RandomVariate[NormalDistribution[0, 1], 500], 
 LabelingFunction -> Above]

enter image description here

You can also use ToolTipe like so:

Tooltip[Histogram[RandomVariate[NormalDistribution[0, 1], 500]]]

enter image description here

3
data = RandomVariate[NormalDistribution[0, 1], 200];
Histogram[data, 50, ImageSize -> 400, LabelingFunction -> Tooltip]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
  • Thank you, greatly appreciated! Couldn't find it in my documentation search. – user5091 Feb 24 '15 at 05:09
  • 1
    @user5091, glad I could help. Apparently there is some max number of bins beyond which tooltips are not shown. – kglr Feb 24 '15 at 05:40