6
$\begingroup$

I want to be able to place a text title centered just inside the bounding box generated by Manipulate yet above the GraphicsGrid and run boxes you see when executing the code. My stripped down code is

Manipulate[ 
 GraphicsGrid[{{Graphics[{Rectangle[]}]}}, ImageSize -> {400, 400}],
 {{run, 0}},
 ControlPlacement -> Left]

Thank you

$\endgroup$

1 Answer 1

9
$\begingroup$

Use the FrameLabel option for Manipulate:

Manipulate[
 GraphicsGrid[{{Graphics[{Rectangle[]}]}}, ImageSize -> {200, 200}],
 {{run, 0}},
 ControlPlacement -> Left,
 FrameLabel -> {{None, None}, {None, "Title goes here"}}]

output

To use the local Manipulate variables in the title you can wrap the title in Dynamic:

FrameLabel -> {{None, None},
               {None, Dynamic[ Row[{"Run: ", run}] ]}}
$\endgroup$
2
  • $\begingroup$ I have a follow-up question. I want to stylize the text in the title (say 16 pts, color, etc) without affecting the text throughout the frame. In particular, I added LabelStyle -> Directive[16], but this made the "run" text size 16 as well. $\endgroup$
    – Stephen
    Nov 11, 2013 at 17:06
  • $\begingroup$ @Stephen play around with Style["some text", 16] There are some examples in the FrameLabel docs under Scope $\endgroup$
    – ssch
    Nov 11, 2013 at 17:08

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.