Message Boards Message Boards

0
|
5073 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Customize with frames a `Manipulate display area with several rows?

Posted 7 years ago

Hi to all

The following code is a starting point of a more elaborate Manipulate notebook with other contents.

Three components manipulated upon, one in a horizontal row and the last two in the second row. However I could not find a way to get two frames frames in the second row.

Manipulate[
 GraphicsColumn[{Text[
    Style[ StringForm["To be `` not to be", tt], Red, Bold, 40, 
     FontFamily -> "Bodoni"]],
   GraphicsRow[{{Graphics[{Blue, Disk[{0, 0}, r]}, 
       PlotRange -> {{-2, 2}, {-2, 2}}]},
     {Plot[f[x], {x, 0, Pi}]}}]
   }, Frame -> All, AspectRatio -> 0.7],
 {f, {Sin, Cos}},
 {r, 1, 2},
 {tt, {"or", "and"}}]

My questions:

  • How can I get here a frame around every component in the second row?
  • Is it possible to adjust the height of individual rows and in each row the width of individual frames?
  • Is AspectRatio the only option controlling the width of the display area?

Thanks

POSTED BY: wojtek potocki
5 Replies
Posted 7 years ago

Hello Neil

Thanks for your answers, the last one being exactly what I wanted. I found out that I could adjust the size of frames in the second row by using ImageSize with Grid

 Manipulate[
  Grid[{{Text[
      Style[StringForm["To be `` not to be", tt], Red, Bold, 40, 
       FontFamily -> "Bodoni"]], 
     SpanFromLeft}, {Graphics[{Blue, Disk[{0, 0}, r]}, 
      PlotRange -> {{-2, 2}, {-2, 2}}, ImageSize -> 100], 
     Plot[f[x], {x, 0, Pi}, ImageSize -> 300]}}, 
   Frame -> All], {f, {Sin, Cos}}, {r, 1, 2}, {tt, {"or", "and"}}]
POSTED BY: Updating Name

Here is the same thing with GraphicsGrid. I think this does what you want.

Manipulate[
 GraphicsGrid[{{Text[
     Style[StringForm["To be `` not to be", tt], Red, Bold, 40, 
      FontFamily -> "Bodoni"]], 
    SpanFromLeft}, {Graphics[{Blue, Disk[{0, 0}, r]}, 
     PlotRange -> {{-2, 2}, {-2, 2}}], {Plot[f[x], {x, 0, Pi}]}}}, 
  Frame -> All, AspectRatio -> 0.7], {f, {Sin, Cos}}, {r, 1, 
  2}, {tt, {"or", "and"}}]
POSTED BY: Neil Singer

You can add Dividers->Center

Manipulate[
 GraphicsColumn[{Text[
    Style[StringForm["To be `` not to be", tt], Red, Bold, 40, 
     FontFamily -> "Bodoni"]], 
   GraphicsRow[{Graphics[{Blue, Disk[{0, 0}, r]}, 
      PlotRange -> {{-2, 2}, {-2, 2}}], {Plot[f[x], {x, 0, Pi}]}}, 
    AspectRatio -> Full, Dividers -> Center]}, Frame -> All, 
  AspectRatio -> 0.7], {f, {Sin, Cos}}, {r, 1, 
  2}, {tt, {"or", "and"}}]

to get

enter image description here

If you want the divider to not have gaps you must use GraphicsGrid and make your text span two columns.

Regards

POSTED BY: Neil Singer
Posted 7 years ago

Hello Thanks for your answer but this is not the layout I want.

To make myself understand in other words, I would like to see the second row as two frames only (two contiguous rectangles only) as this looks much nicer.

You embedded within the frame of the second row two more frames and you have now 3 frames in that row.. Is it possible to avoid that?

Regards

Regards

POSTED BY: wojtek potocki

To many {}{}! Try:

Manipulate[
 GraphicsColumn[{Text[
    Style[StringForm["To be `` not to be", tt], Red, Bold, 40, 
     FontFamily -> "Bodoni"]], 
   GraphicsRow[{Graphics[{Blue, Disk[{0, 0}, r]}, 
      PlotRange -> {{-2, 2}, {-2, 2}}], Plot[f[x], {x, 0, Pi}]}, 
    AspectRatio -> Full, Frame -> All]}, Frame -> All, 
  AspectRatio -> 0.7], {f, {Sin, Cos}}, {r, 1, 
  2}, {tt, {"or", "and"}}]

And check the documentation. Everything is in there!

POSTED BY: l van Veen
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract