4
$\begingroup$

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?

$\endgroup$
2
  • 1
    $\begingroup$ put it inside " ". AxesLabel->{"x axis", "a/GeV^-1"} $\endgroup$ Commented May 2, 2017 at 13:58
  • 1
    $\begingroup$ see: 20566 $\endgroup$ Commented May 2, 2017 at 13:59

2 Answers 2

8
$\begingroup$

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}"}] 

Mathematica graphics

$\endgroup$
2
  • 1
    $\begingroup$ Hope you don't mind the edit :-) (feel free to revert) $\endgroup$ Commented May 24, 2017 at 10:33
  • $\begingroup$ @Szabolcs Of course not. Thanks for your corrections. $\endgroup$ Commented May 24, 2017 at 10:36
2
$\begingroup$

In:

label = Row[ {"a/Ge", Superscript["V", -1] }]; Plot[Sin[x], {x, 0, 2 Pi}, AxesLabel -> label] 

Out:

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ The answer is updated according to your suggestion. :) $\endgroup$ Commented May 24, 2017 at 12:16

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.