How do I avoid double axis when I use movie()
16 次查看(过去 30 天)
显示 更早的评论
The following attached file contains a code that collects frames from two subplots in a loop.
The problem is that the axis duplicates when I use the movie() command, but not during the caption of the frames.
I haven't really been able to find a solution, probably because I am fairly new to matlab :o) But if someone could help me fix it, and maybe explain how and why in a very thoroughly, you would help me a lot :)
/Peter
0 个评论
回答(1 个)
Samayochita
2025-8-18,4:54
编辑:Samayochita
2025-8-21,11:41
Hi Peter Frandsen,
When “movie()” function is used to animate the captured frames, two axes appear instead of one because of the following reason:
By default, “movie()” uses the current axes as the target for playing the movie. Due to this, if the captured frames already contain an axes, they are displayed at an offset from the current axes. This results in the appearance of two axes; the axes seen at the left-bottom is the current axes of the figure, and the axes seen to its right is the axes captured from the frames.
This issue is resolved by playing the “movie()” in the figure instead of the axes, by specifying the figure handle (or "gcf") as the first argument. For example: if "Frames" contains the captured frames, the “movie()” function must be executed as follows:
movie(gcf, Frames);
The above code eliminates the appearance of double axes.
More details about this can be found in the documentation page for “movie” in the link below: https://www.mathworks.com/help/matlab/ref/movie.html
Hope this helps!
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!