I need to label the y-axis of a plot with the form a/GeV^-1, where ^ denotes superscript. But Mathematica always write GeV a instead, interpreting 1/GeV^-1 as GeV. How to avoid this interpretation?
Asked
Active
Viewed 689 times
4
m_goldberg
- 107,779
- 16
- 103
- 257
John Taylor
- 5,701
- 2
- 12
- 33
2 Answers
8
There is a $\LaTeX$ typesetting package, MaTeX, written for such situations by Szabolcs.
<< MaTeX`
Plot[x^2, {x, -10, 10}, AxesLabel -> MaTeX /@ {"\\text{$x$ axis}", "a/\\mathrm{GeV}^{-1}"}]

J. M.'s missing motivation
- 124,525
- 11
- 401
- 574
zhk
- 11,939
- 1
- 22
- 38
2
In:
label = Row[ {"a/Ge", Superscript["V", -1] }];
Plot[Sin[x], {x, 0, 2 Pi}, AxesLabel -> label]
Out:

webcpu
- 3,182
- 12
- 17
AxesLabel->{"x axis", "a/GeV^-1"}– Sumit May 02 '17 at 13:58