3
$\begingroup$

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.

$\endgroup$
1

2 Answers 2

4
$\begingroup$

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

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

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you, greatly appreciated! Couldn't find it in my documentation search. $\endgroup$
    – user5091
    Commented Feb 24, 2015 at 5:09
  • 1
    $\begingroup$ @user5091, glad I could help. Apparently there is some max number of bins beyond which tooltips are not shown. $\endgroup$
    – kglr
    Commented Feb 24, 2015 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.