Is it possible to have sliders and such appear centered on the top or bottom of the panel? The ControlPlacement
options only include Top
, Bottom
, Left
, and Right
, but the Top
placement gives me left-aligned controls, while I want them centered. How do I achieve this?
-
$\begingroup$ You can put there whatever you want, is that enough?: Overlaying a Plot within a Manipulate Control Panel. $\endgroup$ – Kuba♦ Sep 8 '16 at 18:58
-
$\begingroup$ No, unless I misunderstand, it's the slider itself the placement of which I want more control over. From the answer below it looks like there's no simple way to achieve this, other than kludges... :-/ $\endgroup$ – Pirx Sep 8 '16 at 20:19
The Control Image Size
control is provided just to demonstrate the approximate automatic centering of the n
control at varying image sizes
Manipulate[
Style[N[Pi, n], Small],
Column[{
Control[{{cis, 300, "Control Image Size"}, 100, 500, 50,
Appearance -> "Labeled"}]},
ItemSize -> 75,
Alignment -> Center],
Column[{
Control[{{n, 100}, 10^2, 10^4, 10^2,
Appearance -> "Labeled",
ImageSize -> cis}]},
ItemSize -> 75,
Alignment -> Center],
AppearanceElements -> None,
ContentSize -> 600]
-
-
$\begingroup$ I don't really get it... When you change
ItemSize->75
to any other value, e.g.50
, it's not centered anymore. So how is this different from finding a value forSpacer
in my answer? $\endgroup$ – corey979 Sep 9 '16 at 8:28 -
$\begingroup$ @corey979 - I see the difference as the ability to change the
ImageSize
for the control forn
without changing its column'sItemSize
$\endgroup$ – Bob Hanlon Sep 9 '16 at 11:17
This is a way for a workaround:
Manipulate[
Style[N[Pi, n], Small], {{n, 100, Row[{Spacer[175], "n"}]}, 100,
10000, 100, Appearance -> "Labeled", ImageSize -> Automatic},
AppearanceElements -> None, ContentSize -> 600]
Unfortunately you have to set the argument of Spacer[175]
by trial and error; also playing with ContentSize -> 600
and ImageSize -> Automatic
might be required for the window to have nice proportions.
-
$\begingroup$ Hmm, too bad. I guess I'll have to rethink the design I have in mind... $\endgroup$ – Pirx Sep 8 '16 at 20:21