Why x, y-ticks are not shown in avi animation?

3 次查看(过去 30 天)
Why x, y-ticks are not shown in avi animation? Animation is made using VideoWriter(), getframe, writeVideo() functions.
turn=0;
v=VideoWriter('test.avi');
open(v);
set(gca,'nextplot','replacechildren');
N=20;
xx(1:N)=0;
plot( (1:N),'o-' );grid on;ylim([-1.5,1.5]);
title(sprintf('turn %d',turn));
xlabel('address');
ylabel('amplitude');
axis tight manual
for turn=1:100
xx=sin(2*pi*(1:N)*0.1+2*pi*turn*0.01);
plot( (1:N),xx,'o-' );grid on;ylim([-1.5,1.5]);
title(sprintf('turn %d',turn));
legend( sprintf('turn:%d',turn) );
xlabel('address');
ylabel('amplitude');
frame=getframe;
writeVideo(v,frame);
end
close(v);

采纳的回答

KSSV
KSSV 2017-3-17
clc;
clear all ;
turn=0;
v=VideoWriter('test.avi');
open(v);
set(gca,'nextplot','replacechildren');
N=20;
xx(1:N)=0;
hfig = figure ;
h = plot( (1:N),xx,'o-' );grid on;ylim([-1.5,1.5]);
title(sprintf('turn %d',turn));
xlabel('address');
ylabel('amplitude');
% axis tight manual
for turn=1:100
xx=sin(2*pi*(1:N)*0.1+2*pi*turn*0.01);
set(h,'XData',(1:N),'YData',xx) ;
title(sprintf('turn %d',turn));
legend( sprintf('turn:%d',turn) );
xlabel('address');
ylabel('amplitude');
frame=getframe(hfig);
writeVideo(v,frame);
end
close(v);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by