10
$\begingroup$

By default Manipulator produced by Manipulate with Appearance -> "Open" option have two rows: on the first row the slider is placed, on the second other controls:

Manipulate[
 Row[{Plot[Sin[x (1 + a x)], {x, 0, 6}], 
      Plot[Evaluate@D[Sin[x (1 + a x)], x], {x, 0, 6}]
     }, BaseStyle -> ImageSizeMultipliers -> 2/3], 
 {a, 0, 2, Appearance -> "Open"}]

screenshot

How can I get all the controls placed on one row?

$\endgroup$
2
  • 1
    $\begingroup$ Don't know of an option to Manipulator. Perhaps place them individually? (E.g. Row[{Slider[Dynamic[foo]], InputField[Dynamic[foo], FieldSize -> Tiny], Animator[Dynamic[foo], AnimationRunning -> False, AppearanceElements -> {"StepLeftButton", "StepRightButton", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}]}, Spacer[1]] $\endgroup$
    – Michael E2
    Nov 19, 2013 at 17:14
  • $\begingroup$ there is no option build-in for this. You try @MichaelE2 method above, that would be the best solution. May be suggestion should be send to [email protected] for this. I wanted to do this once and found no direct way. $\endgroup$
    – Nasser
    Nov 21, 2013 at 4:46

2 Answers 2

6
$\begingroup$

Following suggestions in the comments, here is a way to achieve what I want:

Manipulate[
 Row[{
   Plot[Sin[x (1 + a x)], {x, 0, 6}],
   Plot[Evaluate@D[Sin[x (1 + a x)], x], {x, 0, 6}]},
               BaseStyle -> ImageSizeMultipliers -> 2/3],
 {a, 0, 2,
  Grid[{{
         Slider[##, Appearance -> Tiny], 
         InputField[#, FieldSize -> Tiny], 
         Animator[##, AnimationRunning -> False, 
          AppearanceElements -> {"StepLeftButton", "StepRightButton", 
           "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}]
       }},
          Alignment -> {Center, Center}] &}]

screenshot

$\endgroup$
7
  • $\begingroup$ You probably want Slider[##, Appearance -> Tiny] -- Manipulate passes the domain as a second argument, (0, 2} in your example. $\endgroup$
    – Michael E2
    Nov 21, 2013 at 12:27
  • $\begingroup$ @Michael Thanks, I have corrected my answer. But it does not solve the problem with InputField positioning. $\endgroup$ Nov 21, 2013 at 13:33
  • 1
    $\begingroup$ Do you mean vertical alignment? Try Grid[{{..}}, Alignment -> {Center, Center}] &. Also set InputField[#, ImageSize -> {60, 15}] to get a better match. Cribbed from SystemFiles/FrontEnd/TextResources/MiscExpressions.tr (look for "Manipulator04"). $\endgroup$
    – Michael E2
    Nov 21, 2013 at 18:05
  • $\begingroup$ @Michael Thanks, I think the problem is solved (a bit strange that it was so hard, btw). If you wish you can post it as an answer and I'll accept it and delete mine. Or I just leave everything as is. $\endgroup$ Nov 22, 2013 at 0:21
  • $\begingroup$ Oh, I have enough rep and not enough time, so let's leave it as it is. Thanks, anyway! :) $\endgroup$
    – Michael E2
    Nov 22, 2013 at 0:35
3
$\begingroup$

Have a look, if this will be better:

    Manipulate[
 Row[{Plot[Sin[x (1 + a x)], {x, 0, 6}], 
   Plot[Evaluate@D[Sin[x (1 + a x)], x], {x, 0, 6}]}, 
  BaseStyle -> ImageSizeMultipliers -> 2/3], {a, 0, 2, 
  Row[{Slider[#, ImageSize -> {200, 20}], 
     InputField[#, ImageSize -> {50, 17}], 
     Animator[#, AnimationRunning -> False, 
      AppearanceElements -> {"StepLeftButton", "StepRightButton", 
        "PlayPauseButton", "FasterSlowerButtons", 
        "DirectionButton"}]}, Spacer[1], 
    BaselinePosition -> Center] &}]

enter image description here

$\endgroup$
3
  • $\begingroup$ Unfortunately your code produces worse output in Mathematica 8.0.4 under Windows 7 x64 than the code in my answer. $\endgroup$ Nov 21, 2013 at 13:31
  • $\begingroup$ @AlexeyPopkov are your names different or what is the reason of i and y at the and? :) $\endgroup$
    – Kuba
    Nov 21, 2013 at 13:50
  • $\begingroup$ @Kuba The names are of the same origin. The way they are written reflects the madness of the Russian Foreign Office inventing, re-inventing and re-re-inventing rules of how to write our names as well as a personal luck. I suggest you distinguish us by the family names. $\endgroup$ Nov 22, 2013 at 9:02

Your Answer

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

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