How to making a movie clip from polar plots with a legend

4 visualizaciones (últimos 30 días)
SeaMoon Kim
SeaMoon Kim el 24 de Mzo. de 2017
Comentada: SeaMoon Kim el 24 de Mzo. de 2017
The function getframe does not include a part of the legend which is located outside the axis of a polar plot. I'd like to know how to include total figure of the polar plot for making a movie clip. The key script I used is as follows.
polar(x,y)
h_legend=legend(str_legend,'Location','Northeast');
set(h_legend,'Position',[0 0 0.4429 0.3349])
F=getframe;

Respuesta aceptada

KSSV
KSSV el 24 de Mzo. de 2017
figure(1)
filename = 'testnew51.gif';
for n = 1:10
polar(rand(5,1),rand(5,1))
h_legend=legend('Test','Location','Northeast');
set(h_legend,'Position',[0 0 0.4429 0.3349])
drawnow
frame = getframe(1);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
if n == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end
end
I think legend is very much included in the frame.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by