Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a huge data and I want to add two labels to the Histogram. the problem here is that the labels are calculated and added automatically to the histogram. for example if I have the following Histogram:

Histogram[RandomVariate[NormalDistribution[0, 10], 20000], 20, 
 LabelingFunction -> (Placed[Rotate[Style[#1, Bold, 14], 90 Degree], 
     Above] &), 
 ColorFunction -> Function[{height}, ColorData["Rainbow"][height]]]

enter image description here

In this Histogram, the Bars labels are calculated automatically. I want to add the percentage of each number at the top of the number. something like the following handmade Histogram :

enter image description here

share|improve this question
add comment

1 Answer 1

Ok I got it:

Histogram[RandomVariate[NormalDistribution[0, 10], 20000], 20, 
 LabelingFunction -> (Placed[
     Column[{Rotate[Style[#1/20000. "%", Red], 90 Degree], 
       Rotate[Style[#1, Bold, 14], 90 Degree]}], Above] &), 
 ColorFunction -> Function[{height}, ColorData["Rainbow"][height]]]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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