I cannot modify the 'FaceAlpha' property of my 'Rectangle' object

16 vues (au cours des 30 derniers jours)
When I create a rectangle using:
>> a=annotation('rectangle')
I can modify its 'FaceAlpha' property. However, when I create it using:
>> b=rectangle();
then there is no 'FaceAlpha' value for me to modify even though both "a" and "b" are shown as 'Rectangle' objects.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 19 Juil 2018
While both "a" and "b" are shown as 'Rectangle' objects in the Workspace, they actually come from two different classes, and therefore have different properties:
>> a = annotation('rectangle');
>> b = rectangle;
>> class(a)
ans =
'matlab.graphics.shape.Rectangle'
>> class(b)
ans =
'matlab.graphics.primitive.Rectangle'

Plus de réponses (0)

Catégories

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

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by