Problem with rotation of the rectangle
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ANKUR KUMAR
le 22 Oct 2017
Réponse apportée : Walter Roberson
le 22 Oct 2017
I want to rotate the rectangle, which I have created using annotation, by 35 degree. How can I do this.
[x,y]=borders('india');
f=figure()
plot(y,x,'Color',[0.1,0.6,0.3])
pbaspect([1 1 1])
h=annotation('rectangle',[.37 .59 .18 .23],'Color','r')
I have tried by entering this command.
rotate(h,90)
but this error is creating problem
H must contain axes children only.
0 commentaires
Réponse acceptée
Walter Roberson
le 22 Oct 2017
"rotate(h,direction,alpha) rotates the graphics object h by alpha degrees. Specify h as a surface, patch, line, text, or image object."
You attempted to rotate an annotation()
By the way, have you looked at rectangle() instead of annotation() ? I am not sure it can be rotate()'d either, but it can be easier to use than annotation() .
I am certain that it is possible to parent a rectangle() object to a hgtransform() and set the transform matrix to do a rotation.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Object Containers dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!