This question already has an answer here:

For my masters thesis I need plots of squared Bessel Processes, but I can't get the axis lables right. I want the y-axis to be labeled $$\left(R_s^{(n)}\right)^2$$ but I have not been able to get the big parentheses in the right position. The best I have accomplished is this:

ListLinePlot[{matris1, matris2, matris3}, ImageSize -> Large, 
 AxesLabel -> {t, 
   SuperscriptBox["(" Subscript[R, t]^"(n)" ")", 2] // DisplayForm}]

which gives this plot enter image description here

As you can see the parentheses are in the wrong place. Any ideas on how to get it right?


marked as duplicate by Kuba Jun 6 '17 at 7:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ 123146, 145059 $\endgroup$ – Kuba Jun 6 '17 at 6:58
  • $\begingroup$ Perhaps related: (21082) $\endgroup$ – Mr.Wizard Jun 6 '17 at 7:24
  • 1
    $\begingroup$ @Kuba I see you were still adding links to the header. Now I think the question "already has an answer" so I agree with the close. $\endgroup$ – Mr.Wizard Jun 6 '17 at 7:29

This may be close enough. If you really need to dial it in consider LaTeX.

RowBox[{"(", SubsuperscriptBox["R", "s", "(n)"], ")"}]^2 // 
  DisplayForm // TraditionalForm

enter image description here

  • 1
    $\begingroup$ I prefer using RawBoxes instead of DisplayForm, but of course that requires that you use valid boxes, which I think is a good thing. $\endgroup$ – Carl Woll Jun 6 '17 at 7:40
  • $\begingroup$ @CarlWoll Good tip. I know about RawBoxes but I have a hard time breaking old habits, including DisplayForm. DisplayForm does work with mixed forms however which I had seen as a convenience. Do I infer correctly that you recommend avoiding e.g. RowBox[{"(", Subsuperscript["R", "s", "(n)"], ")"}]^2 // DisplayForm (with Subsuperscript rather than SubsuperscriptBox)? $\endgroup$ – Mr.Wizard Jun 6 '17 at 8:28
  • 1
    $\begingroup$ Yes, I don't like mixing expressions and boxes. Many times I have to fix bugs where somebody uses a mixture of expressions and boxes that don't work. One example: what should DisplayForm["a"]//TraditionalForm look like? Should it be italicized or not? $\endgroup$ – Carl Woll Jun 6 '17 at 8:30

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