Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
"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
Try Histogram[%, AxesLabel -> {"Average energy", "Number of times"}]. – J. M. Jul 13 '12 at 11:59
... that is, replace \[RightArrow] with -> or \[Rule]. – kglr Jul 13 '12 at 12:12

\[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


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.