MATLAB Answers

How to change background color of GUI

조회 수: 251(최근 30일)
Scott
Scott 29 Oct 2014
답변: hareesh h 4 Jun 2017
I am trying to figure out the MATLAB command which will set the background color for the background of the GUI itself (to change it from the default grey). I have done some searching and have found some stuff, but this code only seems to change the color of the buttons which I have inside the GUI, not the overall background of the GUI. Any thoughts?
Here's the code that changes the buttons:
set(0,'DefaultUicontrolBackgroundColor',[1 0 0]);

  댓글 수: 0

로그인 to comment.

답변(2개)

Robert Cumming
Robert Cumming 30 Oct 2014
does this do what you want:
set ( 0, 'DefaultFigureColor', [1 0 0] )
you can se the colour of any individual figure:
set ( gcf, 'Color', [1 0 0] )
or its best to keep track of your figures rather than assume gcf will be the one you want:
hFig = figure;
set ( hFig, 'Color', [1 0 0] )

  댓글 수: 1

Scott
Scott 30 Oct 2014
yes it does, thanks!

로그인 to comment.


hareesh h
hareesh h 4 Jun 2017
Working solution. Thank you

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

제품


Translated by