Setting background color for patches
9 views (last 30 days)
Show older comments
MathWorks Support Team
on 29 Dec 2016
Answered: MathWorks Support Team
on 29 Dec 2016
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
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';
0 Comments
More Answers (0)
See Also
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!