Animated X, Y scatter plot
조회 수: 19 (최근 30일)
이전 댓글 표시
Hi,
I have three variable X, Y, Z of length 10000 points each .Z represent signal strength. I need to generate animated X,Y plot (scatter) with signal strength represented by color. In general scenerio I clould use method given in below link.
However I would like the followings:
- Instead of adding single point in each loop I would like to add 10 points in each loop.
- Change the color of all old points to 'White' in each loop iteration.
- Represent thenew 10 points being added in current loop by respective colors using there signal strength given in Z. Lets say Z is a number from between -1 to 1, then Z=-1 should represent start color of colormap 'jet' and Z=1 should be last color of colormap 'jet'.
How do we acheive it.
thanks
jayant
댓글 수: 0
채택된 답변
Bjorn Gustavsson
2020년 7월 19일
Have you tried to look at scatter? That should let you do this simply like this:
for i1 = 1:10:(numpoints-10),
plot(xP(1:i1-1),yP(1:i1-1),'w.','markersize',18)
hold on
scatter(xP(i1+(0:9)),yP(i1+(0:9)),32,zP(i1+(0:9)),'filled')
axis([xMin, xMax, yMin, yMax])
caxis([zMin, zMax])
drawnow
end
HTH
댓글 수: 2
Bjorn Gustavsson
2020년 7월 19일
Sorry about that, forgot to add in a hold off at the end of the loop.
Regarding your movie-making:
1, frame_Rate=10000; - this would give you a video for 10000 frames per second, this is to high for our human visual perception. Try with something in the range of 10 - 60, depending on how much of each frame you want the audience to see.
2, (Num_of_frames should rather be the numpoints/312, than the number you set it to.)
3, Perhaps try getframe(gfc) or getframe(gca). Also if you modify the size of the figure-window during the processing things go kaboom.
More later.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Animation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!