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);
0 件のコメント
採用された回答
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 Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!