From: sibir on
The controls are always aligned left inside the pane :-(

From: telefunkenvf14 on
On Jun 12, 4:32 am, sibir <martin.rom...(a)gmail.com> wrote:
> The controls are always aligned left inside the pane :-(

Manipulate[Plot[2 + z + 2 q, {q, 0, 10}, PlotRange -> {10, 10}], {{z,
10/2}, 0, 10}]

Note that you can specify a starting point: {{z, 10/2}, 0, 10}] (*10/2
puts the controller in the middle*)

-RG

From: sibir on
Thanks to Bob Hanlon for suggesting:

Column[{
Row[{
"a ", Slider[Dynamic[a], {1, 5, 1}],
, a = 4; Dynamic[a]}],
Row[{
"b ", Slider[Dynamic[b], {1, 5, 1}],
, b = 2; Dynamic[b]}],
Dynamic[Plot[a + b*x, {x, 0, 1},
PlotRange -> {0, 10},
ImageSize -> 360]]},
Center]

It centers the control fine, but does not use Manipulate.
If I rewrite the exapmle with Manipuate as

Thank you, but I was using Manipulate?
here si the equivalent:

Manipulate[
Plot[a+b*x,{x,0,1},PlotRange->{0,10},ImageSize->360],
{{a,4},1,5,1,Appearance->"Labeled"},
{{b,2},1,5,1,Appearance->"Labeled"},
AppearanceElements->None,
Alignment -> Center]

The contro lis flush left again, the option Alignment acts only in the
white Display area and not on the controls.
The option ControlPlacement appears somewhat limited and has no Center
setting.

Options[Manipulate] shows that there is also ControlAlignment, but I
cannot find any documentation for that option (the Documentation
Center links to RandomChoice!?!).
What are defined settings for ControlAlignment?



From: Alexander Elkins on
Not knowing a way to actually get Manipulate to do the centering
automatically, the cleanest way to do this by hand is to add a Row with
Spacer and text as a label to one of the controls and use it to move the
control to the right, which the rest of the controls then will line up on:

Manipulate[
Plot[a + b*x, {x, 0, 1}, PlotRange -> {0, 10},
ImageSize -> 360], {{a, 4, Row[{Spacer[70], "a"}]}, 1, 5, 1,
Appearance -> "Labeled"}, {{b, 2}, 1, 5, 1, Appearance -> "Labeled"},
AppearanceElements -> None]

Another way is to put the controls in separate rows and again use Spacer:

Manipulate[Plot[a + b*x, {x, 0, 1}, PlotRange -> {0, 10}, ImageSize -> 360],
Row[{Spacer[70],
Labeled[Manipulator[Dynamic[a], {1, 5, 1}, Appearance -> "Labeled"], "a",
Left]}], Row[{Spacer[70],
Labeled[Manipulator[Dynamic[b], {1, 5, 1}, Appearance -> "Labeled"], "b",
Left]}], {{a, 4}, None}, {{b, 2}, None}, AppearanceElements -> None]

Unfortunately, Column centers based on the oversized Manipulator's
Appearance -> "Labeled" which leaves lots of room for its number for and
also needs a Spacer[{360, 0, 0}] to force size within which to center the
rows which also adds its own space above the controls:

Manipulate[Plot[a + b*x, {x, 0, 1}, PlotRange -> {0, 10}, ImageSize -> 360],
Column[{Spacer[360],
Row[{Labeled[Manipulator[Dynamic[a], {1, 5, 1}, Appearance -> "Labeled"],
"a", Left]}],
Row[{Labeled[Manipulator[Dynamic[b], {1, 5, 1}, Appearance -> "Labeled"],
"b", Left]}]}, Center], {{a, 4}, None}, {{b, 2}, None},
AppearanceElements -> None]

Same goes for using Grid instead of Column:

Manipulate[Plot[a + b*x, {x, 0, 1}, PlotRange -> {0, 10}, ImageSize -> 360],
Grid[{{Spacer[360]}, {Labeled[
Manipulator[Dynamic[a], {1, 5, 1}, Appearance -> "Labeled"], "a",
Left]}, {Labeled[
Manipulator[Dynamic[b], {1, 5, 1}, Appearance -> "Labeled"], "b",
Left]}}, Alignment -> Center], {{a, 4}, None}, {{b, 2}, None},
AppearanceElements -> None]

Hope this helps...

Alexander Elkins


"sibir" <martin.rommel(a)gmail.com> wrote in message
news:hva66c$qjt$1(a)smc.vnet.net...
> Thanks to Bob Hanlon for suggesting:
>
> Column[{
> Row[{
> "a ", Slider[Dynamic[a], {1, 5, 1}],
> , a = 4; Dynamic[a]}],
> Row[{
> "b ", Slider[Dynamic[b], {1, 5, 1}],
> , b = 2; Dynamic[b]}],
> Dynamic[Plot[a + b*x, {x, 0, 1},
> PlotRange -> {0, 10},
> ImageSize -> 360]]},
> Center]
>
> It centers the control fine, but does not use Manipulate.
> If I rewrite the exapmle with Manipuate as
>
> Thank you, but I was using Manipulate?
> here si the equivalent:
>
> Manipulate[
> Plot[a+b*x,{x,0,1},PlotRange->{0,10},ImageSize->360],
> {{a,4},1,5,1,Appearance->"Labeled"},
> {{b,2},1,5,1,Appearance->"Labeled"},
> AppearanceElements->None,
> Alignment -> Center]
>
> The contro lis flush left again, the option Alignment acts only in the
> white Display area and not on the controls.
> The option ControlPlacement appears somewhat limited and has no Center
> setting.
>
> Options[Manipulate] shows that there is also ControlAlignment, but I
> cannot find any documentation for that option (the Documentation
> Center links to RandomChoice!?!).
> What are defined settings for ControlAlignment?
>
>
>