Setting background color for patches

9 views (last 30 days)
I am creating a patch according to the following code : 
 
t = 0:pi/5:2*pi;
figure
patch(sin(t),cos(t),'y')
axis equal
But the background is white. I would like the background to be blue. How do I do this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Dec 2016
To set the background color, simply change the color of the axis. This can be done as follows : 
 
t = 0:pi/5:2*pi;
figure
patch(sin(t),cos(t),'y')
axis equal
ax = gca;
ax.Color = 'b';

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!