Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Often, with a Plot or within Manipulate I want to display a graph and, in close proximity to it, a table showing the results of relevant computations. The quickest way to do this is with GraphicsColumn, but that always seems to create cells of identical height and width, which is usually not what I want. Here is a trivial example:

Manipulate[
 GraphicsColumn[{Plot[Sin[x + c], {x, 0, 2*Pi}], 
   TableForm[{{c}}, TableHeadings -> {{"c"}, {"value"}}]}], {c, 0, 3}]

GraphicsColumn makes me sad

Is there some other convenient way to place the table below the graph without an ocean of whitespace, or a way to specify that GraphicsColumn can use cells of differing size?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You can use a normal Column:

Manipulate[Column[{Plot[Sin[x + c], {x, 0, 2*Pi}], Style[
    TableForm[{{c}}, TableHeadings -> {{"c"}, {"value"}}],
    FontFamily -> "Times"]},
  Center, 1], {c, 0, 3}]

Columns second argument lets you choose the alignment and the third one sets the spacing between elements. I also wrapped the TableForm into a Style[...] to change the font from "Courier" to "Times".

enter image description here

share|improve this answer
add comment

In some cases you might also want to insert the table within the figure using Epilog and Inset:

Manipulate[
 Plot[Sin[x + c], {x, 0, 2*Pi},
  Epilog -> 
   Inset[Style[
     TableForm[{{c}}, TableHeadings -> {{"c"}, {"value"}}], {Large, 
      Bold}], {5, .5}]], {c, 0, 3}]

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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