MATLAB: Setting background color for patches

axesaxisbackgroundchangecolorMATLABobjectpatch

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?

Best Answer

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';