3
$\begingroup$

I am trying to make a fairly complicated plot that involves LineLegend.

As part of the LineLegend's label, I am using Row[{("test=0.01")/("testing=0.01")}].

Is there a straightforward way to align the equal signs?

$\endgroup$
1
  • 1
    $\begingroup$ Column[{"test=0.01", "testing=0.01"}, Alignment -> Right, Dividers -> {False, {False, True, False}}] $\endgroup$
    – Bob Hanlon
    Oct 28, 2022 at 21:00

1 Answer 1

5
$\begingroup$

Alignment can sometimes take a character to be aligned on. So, in this case (I've changed the text slightly so you can see the effect):

Column[{("test=0.01"), ("testing=0.001")}, Alignment -> "="]

I've also changed it to column, since you want vertical alignment. To get it to look like a fraction:

Column[{("test=0.01"), ("testing=0.001")}, Alignment -> "=", Dividers -> {False, {False, True, False}}]

And actually, Column takes alignment as an optional second argument, so this works:

Column[{"test=0.01", "testing=0.001"}, "=", Dividers -> {False, {False, True, False}}]
$\endgroup$
1
  • $\begingroup$ Thanks so much! $\endgroup$
    – MathIsHard
    Oct 29, 2022 at 6:19

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.