13
$\begingroup$

I have a Manipulate construct with a square Graphic on the left side and all the controls placed on the right side. There are so many (and also pretty large) control items, however, that they take up about double the vertical space of the graphic.

Is there a simple way to place the controls into two seperate columns (like in the sketch below)?

 _________
|         | Control 1 | Control 4
| Graphic | Control 2 | Control 5
|_________| Control 3 | Control 6

I could do something similar using Item and Grid, but as far as I know, in such a construct the default control syntax wouldn't work and I'd have to re-program all the controls with Dynamic. It seems ControlPlacement also does not support multiple columns.

Edit: To be clear: I'm trying to find a solution that preserves as much of Manipulate's properties as possible, i.e. things like alignment, labeling and using default control types.

$\endgroup$

1 Answer 1

18
$\begingroup$

I am not sure why you can't just use Grid?

Manipulate[Plot[Sin[x], {x, -lim, lim}],
 Grid[{
   {Control[{{lim, Pi, "limit"}, Pi/10, 2 Pi, Pi/10, 
      ImageSize -> Tiny}], Button["A", ImageSize -> 100]},
   {Button["B", ImageSize -> 100], Button["C", ImageSize -> 100]},
   {Button["D", ImageSize -> 100], Button["E", ImageSize -> 100]}
   }, Frame -> All],
 ControlPlacement -> Right
 ]

enter image description here

$\endgroup$
3
  • $\begingroup$ Thanks, but I already know it can be done to a certain extent like this. I'm basically looking for some solution that fully preserves the Manipulate desing (along with alignment of the labels and controls) and the default control types, such as displaying a color slider automatically when writing something like {{textcolor, Orange, "Text color"}, Orange}. $\endgroup$
    – einbandi
    Nov 17, 2012 at 1:32
  • 2
    $\begingroup$ @einbandi, this answer already covers those requirements: all you need is to put your Manipulate controls inside Control. You don't lose any feature of Manipulate. That is, Control[{{textcolor, Orange, "Text color"}, Orange}] automatically uses ColorSlider. $\endgroup$
    – kglr
    Nov 17, 2012 at 1:57
  • $\begingroup$ Okay, thanks. I was totally missing the Control command there. I'll see then if I can achieve optically pleasing results with that $\endgroup$
    – einbandi
    Nov 17, 2012 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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