Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align elements of Row[] to Bottom or Top in Mathematica?

When I write

Row[ {Framed@Column[{1,2}], Framed@"123"},  Alignment->Top]

Mathematica graphics

or

Row[ {Framed@Column[{1,2}], Framed@"123"},  Alignment->{Left,Top}]

Mathematica graphics

in either case, nothing happens. Default alignment is Center, and elements are listed aligned to each other's midline.

Grid[ {{Framed@Column[{1,2}], Framed@"123"}}, Alignment->Top]

Mathematica graphics

works just fine, but Grid[] is an overkill when a Row[] would suffice.

Help system says Alignment should work (lists {Left,Baseline} as example), but it doesn't seem to be changeable. I'm using v8.0.4.

like image 733
Gregory Klopper Avatar asked Feb 22 '23 05:02

Gregory Klopper


1 Answers

The Alignment option in Row does not align the individual elements themselves, but rather these elements within an outer bounding box. This can be seen with:

Framed@Row[{Framed@Column[{1, 2}], Framed@"123"}, 
  ImageSize -> {150, 150}, Alignment -> {Left, Top}]

enter image description here

Framed@Row[{Framed@Column[{1, 2}], Framed@"123"}, 
  ImageSize -> {150, 150}, Alignment -> {Center, Bottom}]

enter image description here

Use Grid instead.

like image 200
Mr.Wizard Avatar answered Apr 26 '23 14:04

Mr.Wizard