2
$\begingroup$

Whenever I have subscripts in my labels, the FontSlant seems to change to italic. I want the plain style, even for legends. How to fix it?

Plot[x^3 + 1, {x, -10, 10}, Frame -> True, 
 FrameLabel -> {"\!\(\*SubscriptBox[\(T\), \(a\)]\)(m^3)", 
   "\!\(\*SubscriptBox[\(Y\), \(a\)]\)/\!\(\*SubscriptBox[\(Y\), \
\(b\)]\)"}, FrameStyle -> Black, 
 LabelStyle -> 
  Directive[Black, FontSize -> 14, FontFamily -> "Helvetica", 
   FontSlant -> "Plain"], 
 FrameStyle -> 
  Directive[Black, FontColor -> Black, FontSize -> 14, 
   FontFamily -> "Helvetica", FontSlant -> "Plain"], 
 PlotRange -> {-30, 300}, 
 PlotLegends -> 
  Placed[{"\!\(\*SubscriptBox[\(T\), \(abc\)]\)"}, {Scaled[{0.95, 
      0.15}], {0.95, 0.35}}]]

enter image description here

$\endgroup$
2
  • $\begingroup$ You really should use Latex for all your labels. It looks much better than anything Mathematica has. Check MaTeX package. $\endgroup$
    – Nasser
    Commented Nov 8, 2023 at 6:50
  • $\begingroup$ @nasser Thanks very much, I'll check that. $\endgroup$
    – lia
    Commented Nov 8, 2023 at 7:36

1 Answer 1

4
$\begingroup$
Plot[x^3 + 1, {x, -10, 10}, Frame -> True, 
 FrameLabel -> ({"\!\(\*SubscriptBox[\(T\), \(a\)]\)" // 
      StandardForm // DisplayForm, 
    "\!\(\*SubscriptBox[\(Y\), \(a\)]\)/\!\(\*SubscriptBox[\(Y\), \(b\
\)]\)" // StandardForm // DisplayForm}), FrameStyle -> Black, 
 LabelStyle -> 
  Directive[Black, FontSize -> 14, FontFamily -> "Helvetica", 
   FontSlant -> "Plain"], 
 FrameStyle -> 
  Directive[Black, FontColor -> Black, FontSize -> 14, 
   FontFamily -> "Helvetica", FontSlant -> "Plain"], 
 PlotRange -> {-30, 300}, 
 PlotLegends -> 
  Placed[{"\!\(\*SubscriptBox[\(T\), \(abc\)]\)" // StandardForm // 
     DisplayForm}, {Scaled[{0.95, 0.15}], {0.95, 0.35}}]]

enter image description here

$\endgroup$
3
  • $\begingroup$ There is a problem here now that the FontFamily does not work anymore!@Syed $\endgroup$
    – lia
    Commented Nov 11, 2023 at 7:51
  • $\begingroup$ Perhaps someone will add a MateX solution to this page. This was a convenient hack and obviously has its limits. $\endgroup$
    – Syed
    Commented Nov 11, 2023 at 8:03
  • $\begingroup$ Thanks anyway, it helped though $\endgroup$
    – lia
    Commented Nov 11, 2023 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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