# Can't get alignment to work in Labeled function

I'm probably missing something obvious here, but I haven't been able to figure out how to get the Mathematica function Labeled to print an expression with a left-justified label on top of it. The Help page for Labeled says that

Labeled[expr, lbl, pos] places lbl at a position specified by pos

and that pos may have the form {side, align}, in which case the label appears "on the specified side with the specified alignment." It then says that side may be either Left, Right, Top, or Bottom, while align may be either Center, Left, Right, Top, or Bottom. Although it's possible that I've misinterpreted this, I would have thought that the following code would thus place the label "Foo" left-justified on top of the expression {a, b, c, d}:

Labeled[
Framed[ {a, b, c, d} ],
"Foo",
{Top, Left}
]


The above code, though, places the label "Foo" centered on top of the expression {a, b, c, d}. Any idea what's going on here?

• I get the same on Win 8.1 Pro in 10.4.1 and 11.0. I think it could be a bug. Report to WRI. – Edmund Sep 21 '16 at 10:08
• Many thanks, @Edmund! That was my guess as well, but based on the response from @Mr.Wizard, I wonder whether there's a problem with my code and/or my analysis. I'm looking forward to reading his response to the comments I just appended to his response. – grateful user Sep 21 '16 at 22:55

This is a syntax ambiguity arising from the allowance for this form:

Labeled[Framed[{a, b, c, d}], {"Foo", "Bar"}, {Top, Left}]


Labeled[Framed[{a, b, c, d}], "Foo", {{Top, Left}}]

• @gratefuluser Honestly I did not analyze it to this degree, I just hoped to offer a quick solution. I tend to agree (without exhaustive consideration) that the function could recognize Labeled[x, "foo", {Top, Left}] as you intended, but I am not prepared to say that the fact that it does not is a bug. If you do contact support regarding this I am curious to know what they say. – Mr.Wizard Sep 22 '16 at 14:30
• Me neither, but i) the argument format does allow for multiple labels on the same side without warning and ii) the documentation never states that there is such limitation. So I expected it to work (though I knew it wouldn't, but that is only because I know that it is implemented by Grid or similar with a limited number of positions instead of Graphics and practically unlimited coordinates). – István Zachar May 14 '19 at 21:17