MATLAB Answers

How do I change the default background color of all FIGURE objects created in MATLAB?

1,130 views (last 30 days)
I would like my figures to have a white background and use the following commands:
Instead of changing the color of each figure individually, I would like to set the background color of all the figures for the entire session.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
A list of factory-defined graphics settings that can be manipulated can be obtained by executing this command at the MATLAB prompt:
To set the default color for all graphics objects, the 'defaultfigurecolor' property of the ROOT graphics object needs to be defined as follows:
set(0,'defaultfigurecolor',[1 1 1])
Once the property is set, all succesive figures created will inherit this property from the ROOT graphics object.
More information on setting default color properties for handle graphics objects can be found here:


Leo Simon
Leo Simon on 12 Apr 2015
This command sets the boundary area for all figures to white. I'd like to set the default color for the interior region to a specified color. Once I've created a figure, I can do this for just that figure (or subplot of that figure) with
But I'd like to set this color by default.
doesn't suggest field that might do this.
Thanks in advance!
Saurabh Harsh
Saurabh Harsh on 23 Apr 2015
You can do that using:
This syntax can be used for any object and any property to define default values. For example you can also set DefaultTextColor, DefaultLineStyle etc.
Andyzhuang on 30 Aug 2018
Hi, I want to set the background of quiver as black and I tried these codes but it doesn't work. Do you have any advise or comments? Thanks in advance.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!