Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
How to rotate() annotation graphics?
Posted: Nov 11, 2012 8:19 AM

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

Date Subject Author
11/11/12 Nasser Abbasi
11/11/12 dpb
11/11/12 Nasser Abbasi
11/11/12 dpb
11/11/12 Nasser Abbasi
11/11/12 dpb