Group Abstract Group Abstract

Message Boards Message Boards

Sizing and Placing a Caption Under a Plot

Posted 12 years ago
POSTED BY: Gregory Lypny
2 Replies
Posted 12 years ago

Thanks David,

I'll give it a try. Never thought of using TextCell. Wonder if it will work within a Manipulate, although that's really not a concern for me.

Thanks once again,

Gregory

POSTED BY: Gregory Lypny

Perhaps something like this? You may have to do a little tweaking of the parameters:

With[{imageSize = 500},
 Pane[
  Column[{
    Plot[x, {x, 1, 3}, ImageSize -> imageSize]
     Row[{TextCell[
        "I've created a plot and a caption for it. The caption is a \n    few lines long. I want to size the caption so that it is the same \n    width of the plot and then place it under the plot. I would then \n    export the two combined as a PDF.", "Text"]}, 
      ImageSize -> imageSize + 30]
    }
   ],
  ImageSize -> imageSize + 50]
 ]

And you can change the "Text" in the TextCell CellStyle to whatever other CellStyle you might wish. Or you can add options to the TextCell to control aspects such as the FontSize as in:

With[{imageSize = 500}, 
 Pane[Column[{Plot[x, {x, 1, 3}, 
      ImageSize -> 
       imageSize] Row[{TextCell[
        "I've created a plot and a caption for it. The caption is a \
few lines long. I want to size the caption so that it is the same \
width of the plot and then place it under the plot. I would then \
export the two combined as a PDF.", "Text", FontSize -> 10]}, 
      ImageSize -> imageSize + 30]}], ImageSize -> imageSize + 50]]
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard