Message Boards Message Boards

How to make default option in Manipulate Appearance -> "Labeled"?

Here is an example of code I might use:

Manipulate[Plot[a Sin[b x],{x,-2Pi,2Pi}],{a,-3,3,Appearance->"Labeled"},{b,-3,3,Appearance->"Labeled"}]

I like to see the value of the Manipulate variable by default. Is there a way to make this Appearance option the default so that I don't have to add it to every variable? I tried


but Appearance is not one of the options given.

2 Replies

Thanks for the reply and explaining it so well. I thought it should not be an option for Manipulate, but I didn't realize Manipulator was what I needed. Thanks for the warning of how it would work in further sessions. Perhaps I could add an Initialization Cell to help set this when I want it.

You are correct that Appearance is not an option of Manipulate. Note that it does not appear in the options position of the function (i.e., the sequence of arguments of the function at the end. In fact what is being done here is that the Appearance option is being passed into the user interface element that the iterator list it appears in creates. In fact the case where you might want to have Appearance->"Labeled" is exactly the case where the iterator will be a Slider. And this is created internally within Manipulate using the function Manipulator. You might then think that executing

SetOptions[Manipulator, Appearance -> "Labeled"]

Would solve the problem. And in fact if you do this and then execute

Manipulate[x, {x, 1, 10}]

the result will be a Labeled slider. However, if you close your Mathematica session and then reopen it, the resulting Mathematica session no longer has the Manipulator option set to Appearance -> "Labeled" because the new Mathematica session has reset it to its default.

So the short version of this is that it generally is better to explicitly put the Appearance -> "Labeled" option in the iterator explicitly. Also this allows someone else who is reading the code to see exactly what is explicitly intended.

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract