Skip to main content
PLotLabels is a new built-in in v10.4
Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293

How can I turn off SingleLetterItalics in PlotLabelsPlotLabel, etc, when the Options Inspector won't do it?

Post Merged (destination) from mathematica.stackexchange.com/questions/6308/…
Tweeted twitter.com/#!/StackMma/status/201677165337640960
Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

How can I turn off SingleLetterItalics in PlotLabels, etc, when the Options Inspector won't do it?

One of the requirements set for the graphing project I am working on is that plot and axis unit labels sometimes need to include superscripts. Here is an approximately minimal example (I have some plotting options set differently from the default, but these shouldn't matter here):

fakedata101 = 
  FoldList[0.92 #1 + #2 &, 0., 
   RandomVariate[NormalDistribution[0, 0.5], 100]];
ListLinePlot[fakedata101, Filling -> Axis, PlotStyle ->Red, 
 FillingStyle -> Red, 
 PlotLabel -> "Test Label in k(\!\(\*SuperscriptBox[\(m\), \(2\)]\))"]

enter image description here

The SingleLetterItalics option appears to be turned off in the Options Inspector, but that doesn't seem to work for String-format text labels. It does work if set explicitly, e.g. when adding Text in an Epilog with an explicit Style wrapping:

Epilog -> 
 Text[Style["\!\(\*SuperscriptBox[\(Text with Footnote marker\), \((a)\)]\)", 
   SingleLetterItalics -> False], {10, -1.5}]

Is there a way I can robustly turn off SingleLetterItalics in styled text such as this? I would prefer not to have to catch every String passed to a PlotLabel or AxisLabel and send it through a Style command if I could help it.