使用Manipulate在Mathematica中控制布局位置

5
我希望将粉色和绿色复选框控件显示在同一行上。尽管我在ControlPlacement帮助文档中进行了广泛的查找,但我无法使其正常工作。
Manipulate[
Graphics[{If[thePink, {Pink, Disk[{5, 5}, r]}], 
If[theGreen, {Green, Disk[{4, 2}, r]}]}, 
PlotRange -> {{0, 20}, {0, 10}}], {{r, 1, 
Style["Radius", Black, Bold, 12]}, 1, 5, 1, ControlType -> Setter, 
ControlPlacement -> Top}, {{thePink, True, 
Style["Pink", Black, Bold, 12]}, {True, False}}, {{theGreen, False,
Style["Green", Black, Bold, 12]}, {True, False}}]

enter image description here

1个回答

5
使用 Row[ ]Control[ ]:
Manipulate[Graphics[{If[thePink, {Pink, Disk[{5, 5}, r]}],
   If[theGreen, {Green, Disk[{4, 2}, r]}]}, PlotRange -> {{0, 20}, {0, 10}}], 
   {{r, 1, Style["Radius", Black, Bold, 12]}, 1, 5, 1, ControlType -> Setter, 
                                                     ControlPlacement -> Top},
 Row[
  {Control@{{thePink, True, Style["Pink", Black, Bold, 12]}, {True, False}}, 
   Spacer[20], 
   Control@{{theGreen, False, Style["Green", Black, Bold, 12]}, {True,False}}}]]

enter image description here


一如既往,非常感谢。希望我能尽快提出更难的问题,你真是太棒了! - 500

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接