Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to rotate() annotation graphics?
Replies: 5   Last Post: Nov 11, 2012 10:41 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,694
Registered: 2/7/05
How to rotate() annotation graphics?
Posted: Nov 11, 2012 8:19 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Compare this, which rotates a patch() fine:

-----------------------------
close all
figure
h=patch([-0.5,-0.5,0.5,0.5],[-0.5,0.5,0.5,-0.5],'r');
axis([-1 1 -1 1]);
for i=1:30
rotate(h,[0,0,1],1);
pause(0.1);
drawnow
end
----------------------------

But this rectangle below does not rotate, created using
annotation:

--------------------------------------
close all
figure;
axis([-1 1 -1 1]);
h=annotation('rectangle', [.3 .3 .3 .3])

for i=1:30
rotate(h,[0,0,1],1);
pause(0.1);
drawnow
end
-----------------------

Even though both are handle graphics?

Looking at rotate.m it seems to only supports subset of objects:

------------------------
for i=1:numel(h),
t = get(h(i),'type');
skip = 0;
if strcmp(t,'surface') || strcmp(t,'line') || strcmp(t,'patch')
............
elseif strcmp(t,'text')
.............
elseif strcmp(t,'image')
............
else
skip = 1;
end
------------------------

So, it only rotates surface, line, patch, text and image.

So, how does one rotate annotations?

I am using 2012a.

thanks,
--Nasser



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.