I'm a little embarrassed asking such a simple question, but it's a problem I'm having since a long time. I want to e.g. have a plot beside some text. Now, I want that the top line of the plot and the top line of the text are at the same hight. I can't get this to work. When I use Alignment -> Top the text is always aligned at the middle and I don't know why. This sounds all very simple, so any help is appreciated. E.g.

Row[{ListPlot[{1, 2, 1, 3}, Joined -> True, Frame -> True,ImageSize -> 400], "    ", Framed@Grid[{{"test"}, {"test2"}}]}, Alignment -> Top]

The result is>

enter image description here

So top line of plot and of text not at the same height.

  • $\begingroup$ Use Grid[{{...}},Alignment->{Center,Top}]. p.s. Spacer is neater than " ". $\endgroup$ – Kuba Jan 16 '14 at 20:44
  • $\begingroup$ I tried this, but then the text is below the plot. I want it beside the plot, but so that the lines at the top of the plot and that of the text are aligned. So, the text needs to go higher. – Thanks for the 'Spacer' tip, though. $\endgroup$ – Mockup Dungeon Jan 16 '14 at 20:52
  • $\begingroup$ I believe you are talking about Grid[{{...},{...}}]. It's not what I meant, the answer of PatoCorillo is. $\endgroup$ – Kuba Jan 16 '14 at 21:06
  • $\begingroup$ Yes, I have it now. Thanks. I didn't realise this doesn't work with Row. $\endgroup$ – Mockup Dungeon Jan 16 '14 at 21:08
Grid[{{ListPlot[{1, 2, 1, 3}, Joined -> True, Frame -> True, 
    ImageSize -> 400], Framed@Grid[{{"test"}, {"test2"}}]}}, 
 Alignment -> Top]
  • $\begingroup$ OK, interesting, now I got it. Curious this doesn't work with Row! Thanks. $\endgroup$ – Mockup Dungeon Jan 16 '14 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.