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

조회 수: 297 (최근 30일)
I would like my figures to have a white background and use the following commands:
set(gcf,'color','white')
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.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
A list of factory-defined graphics settings that can be manipulated can be obtained by executing this command at the MATLAB prompt:
get(0,'Factory')
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:
<http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/creating_plots/f7-21465.html>
  댓글 수: 1
Leo Simon
Leo Simon 2015년 4월 12일
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
set(gca,'Color',rand(1,3))
But I'd like to set this color by default.
get(0,'Factory')
doesn't suggest field that might do this.
Thanks in advance!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by