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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!