Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please consider the following:

 Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}];

Now, I would like to change the background colour to yellow. I tried the following, but in this case the nice looking rounded corners of the manipulate element get lost:

Panel[#, Background -> Yellow] &@
 Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}, 
  Paneled -> False]

Maybe somebody has a better idea.


The background colour of Manipulateis by default grey. <code>Manipulate</code>

In addition the graphical element in which the Manipulate is embedded has rounded corners rounded corner which I would like to keep. Applying my approach will change the colour but I loose the rounded corners.

share|improve this question
What rounded corners? Please include an image of your desired result – Dr. belisarius Aug 24 '12 at 14:34
Panel[] (and thus Manupulate[] too) in Windows 7 does not have round corners. It is kind of system dependent. – Yu-Sung Chang Aug 24 '12 at 17:31
@NasserM.Abbasi Good advice, because I intend to deploy my notebook as a CDF. Would the wrapper cause problems then? If so, I may post a new thread on this issue. – John Aug 24 '12 at 23:50
up vote 9 down vote accepted

If you would like to change background of Manipulate function - this is a way. Note I'll show you most difficult case when you have to go from light to dark colors change - then you have to pay attention to styling of internal graphics too, so everything (like ticks) are visible.

st = {FontColor -> GrayLevel[.7]};
  Plot[Sin[x (1 + a x)], {x, 0, 6}, Background -> GrayLevel[.3], 
   PlotStyle -> {Thick, Orange}, Frame -> True, BaseStyle -> st, 
   ImageMargins -> 7], {{a, 1, "frequency"}, 0, 2, 
   Appearance -> "Labeled"}, Paneled -> False], FrameMargins -> 30, 
 Background -> Black, BaseStyle -> st, RoundingRadius -> 10]

enter image description here

share|improve this answer
Nice... can't say I agree with your dark color scheme though... – kale Aug 24 '12 at 14:48
@VitaliyKaurov Good one! In my case I think I can delete the BaseStyle-Options within the Framed-environment. Otherwise somehow the corners look very pixeled. – John Aug 24 '12 at 14:56
@John Thanks! Sure, I was just trying to show full scope. Maybe reducing RoundingRadius can also help. BTW if you accepted it, you could probably up vote it too? ;-) – Vitaliy Kaurov Aug 24 '12 at 14:58
@VitalyKaurov I'm sorry. I didn't pay attention for a sec. – John Aug 24 '12 at 15:18

Wrapping Manipulate in Style and using DefaultOptions to set background color of Panel and then adjusting FrameMargins manually:

Plot[Sin[x (1 + a x)], {x, 0, 6}, Background -> None], {a, 0, 2}], 
DefaultOptions -> {Panel -> {Background -> LightBlue}}], 
FrameMargins -> {{-3, -2}, {-2, -3}}]

you get

enter image description here

Plot[Sin[x (1 + a x)], {x, 0, 6}, Background -> LightBlue], {a, 0, 2}, 
FrameMargins -> {{-4, -3}, {-2, -2}}], 
DefaultOptions -> {Panel -> {Background -> LightBlue}}], 
      FrameMargins -> {{-3, -2}, {-2, -3}}]


enter image description here

Update: Screenshot of free-cdf version deployed as stand-alone and viewed in browser window:

enter image description here

share|improve this answer
uh, this is really hard on the eyes! – Yves Klett Aug 24 '12 at 16:22
@YvesKlett, hope LightBlue is better :) – kglr Aug 24 '12 at 17:50
@kguler please check Nasser M. Abassis' comment on wrappers around Manipulate and demos. – John Aug 24 '12 at 23:52
@John, I am not sure, but I think Nasser's comment refers to the requirements for demonstrations for deploying in Wolfram Demonstrations site. I was able to use the code in a new cdf document, deploy it as stand-alone and view it in IE browser without any problem. I posted the screenshot. – kglr Aug 25 '12 at 0:34

Not sure if you can do it in a Manipulate wrapper, but you could technically build your own as such:

Panel[Column[{Manipulator[Dynamic[a], {0, 10}], 
   Dynamic[Plot[Sin[x (1 + a x)], {x, 0, 6}]]}], 
 Background -> LightGreen]

enter image description here


Panel[Column[{Manipulator[Dynamic[a], {0, 10}], 
   Panel[Dynamic[Plot[Sin[x (1 + a x)], {x, 0, 6}]], 
    Background -> LightGreen]}]]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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