【问题标题】:Control Placement using Manipulate in Mathematica在 Mathematica 中使用 Manipulate 控制放置
【发布时间】:2011-06-09 20:48:10
【问题描述】:

我想让粉色和绿色复选框控件显示在一行上。尽管对 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}}]

【问题讨论】:

    标签: wolfram-mathematica controls


    【解决方案1】:

    使用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}}}]]
    

    【讨论】:

    • 一如既往,谢谢。我希望我能尽快提出更难的问题,你真是太好了!
    猜你喜欢
    • 1970-01-01
    • 2014-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-19
    • 1970-01-01
    • 2011-09-22
    • 2011-10-10
    相关资源
    最近更新 更多