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 plotted a histogram and I used AxesLabel for labeling X axis and Y axis But it went wrong. How to do it?.

Xarray = A @@@ Tuples[Range[0, 9], 3];

M = RandomSample[Xarray, 7]

Table[energies =  RandomVariate[ExponentialDistribution[1.5], {Length@M}];

Total[energies/7], {i, 1000}];

Histogram[%, AxesLabel \[RightArrow] {"Average energy", "Number of times"}]
share|improve this question
3  
"But it went wrong" - how? Could you show a picture of what you've tried, and why you're dissatisfied with Mathematica's output? (AxesLabel works fine, BTW.) –  J. M. Jul 13 '12 at 11:54
3  
Try Histogram[%, AxesLabel -> {"Average energy", "Number of times"}]. –  J. M. Jul 13 '12 at 11:59
1  
... that is, replace \[RightArrow] with -> or \[Rule]. –  kguler Jul 13 '12 at 12:12

1 Answer 1

\[Rule] is not the same as \[RightArrow]

Compare this (it works):

 r = Table[Total[RandomVariate[ExponentialDistribution[1.5], {7}]/7], {i, 1000}];

 Histogram[r, AxesLabel \[Rule] {"Average energy", "Number of times"}]

With this (does not work)

 Histogram[r, AxesLabel \[RightArrow] {"Average energy", "Number of times"}]

\[Rule] is usually entered as two chars "->"

share|improve this answer

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.