Within the Plot[] environment I'd like to label one of the axes as


with square brackets to denote that $a_0$ is the unit. How can I achieve this? So far I've tried

Text[Style[ToExpression["r [a_0]", TeXForm, HoldForm]]

but this outputs


So, the subscript comes out correctly but not the brackets.


Use a StringForm:

Plot[x, {x, 0, 1},
AxesLabel -> {Text[StringForm["r[``]", Subscript[a, 0]]], Automatic}]

It is alternatively possible to enter the subscripts directly inside the quoted string (without using StringForm).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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