unable to adjust real time views of surf plots in plot-drawnow animations

조회 수: 1 (최근 30일)
feynman feynman
feynman feynman 2024년 2월 12일
댓글: feynman feynman 2024년 2월 28일
In plot-drawnow animations, how to use the mouse to adjust the view of a 3d surf plot? I've found that there's no response to any real time mouse adjustment and the view stays unchanged.
  댓글 수: 5
feynman feynman
feynman feynman 2024년 2월 27일
thank you so much for resolving this @Vinayak this is the best answer!
feynman feynman
feynman feynman 2024년 2월 27일
a followup question, rotate3d on doesn't seem to play well in live scripts when figures aren't shown in a separate file! Once rotate3d on, animations disappear but only the final screenshot is retained. Any solution?

댓글을 달려면 로그인하십시오.

답변 (1개)

Benjamin Kraus
Benjamin Kraus 2024년 2월 27일
편집: Benjamin Kraus 2024년 2월 27일
@Vinayak has the right idea, although pause should be unnecessary and drawnow is definitely the preferred approach.
  • drawnow will guarantee that the graphics are drawn and MATLAB responds to any user interactions or callbacks that occured during your loop.
  • pause will pause execution for a moment which may give graphics a chance to update, and may respond to callbacks, but if MATLAB has't finished drawing or responding to callbacks before the time expires, it does not guarantee that these things occur.
You can use both pause and drawnow if you want to both guarantee that each frame draws, but also slow down the loop if it is running too quickly.
  댓글 수: 1
feynman feynman
feynman feynman 2024년 2월 28일
Thanks a lot! A followup question, rotate3d on doesn't seem to play well in live scripts when figures aren't shown in a separate file! Once rotate3d on, animations disappear but only the final screenshot is retained. Any solution?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by