Setting background color for patches

3 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 29 Déc 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?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 29 Déc 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';

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by