8
$\begingroup$

I'd like the square brackets to be taller in the following legend label, so that they extend as high as the 6 in $10^6$. The most success I've had is by using MaTeX, but I'd prefer a built-in solution, because MaTeX looks really inconsistent with all the other text in the image.

Note that LabelStyle -> 10 makes the output look worse than it would otherwise, because the "6" superscript seems to look extra large compared to the way it looks normally. So a partial solution would just be to shrink the size of the exponent somehow. But still, I'd prefer to keep the exponent as is and just increase the height of the brackets.

LineLegend[{Red, Green, Blue}, {1, 2, 3}, 
 LegendLabel -> "d [\!\(\*SuperscriptBox[\(10\), \(6\)]\) km]", 
 LabelStyle -> 10]

enter image description here

$\endgroup$

1 Answer 1

9
$\begingroup$
LineLegend[{Red, Green, Blue}, {1, 2, 3}, 
 LegendLabel -> StandardForm[d [HoldForm[10^6 km]]], 
 LabelStyle -> 10]

enter image description here

LineLegend[{Red, Green, Blue}, {1, 2, 3}, 
 LegendLabel ->  StandardForm @
   Style[d[HoldForm[10^1^2^3^4^5^6  km]], SpanMaxSize -> ∞], 
 LabelStyle -> 10]

enter image description here

LineLegend[{Red, Green, Blue}, {1, 2, 3}, 
 LegendLabel -> StandardForm @
   Style[d[HoldForm[10^1^2^3^4^5^6  km]], 
    SpanMaxSize -> ∞, SpanSymmetric -> False], 
 LabelStyle -> 10]

enter image description here

$\endgroup$
3
  • $\begingroup$ Beautiful! Two questions: Can we stick an extra space between the "d" and the first "["? And can we change the font to whatever the default "text" font is (to match the other fonts in the figure so that, e.g., the 0 does not have a dot in it)? $\endgroup$
    – WillG
    Commented Mar 1 at 2:40
  • 1
    $\begingroup$ Regarding #1, the following works: LineLegend[{Red, Green, Blue}, {1, 2, 3}, LegendLabel -> StandardForm[d Spacer[3] [HoldForm[10^6 km]]], LabelStyle -> 10] $\endgroup$
    – WillG
    Commented Mar 1 at 18:10
  • 1
    $\begingroup$ Regarding #2, finally got it! LineLegend[{Red, Green, Blue}, {1, 2, 3}, LegendLabel -> StandardForm@Style[d Spacer[3][HoldForm[10^6 km]], SpanMaxSize -> Infinity, FontFamily -> "Arial", FontWeight -> "Regular", FontColor -> RGBColor[0., 0., 0.], SpanSymmetric -> False], LabelStyle -> 10] $\endgroup$
    – WillG
    Commented Mar 1 at 19:10

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.