Update a 3D graph without resetting viewpoint?

I generate a 3D graph. My user, using the mouse, rotates it and changes the viewpoint. Then the user modifies a parameter and I regenerate the graph. The graph snaps back to its original, default 3D viewpoint. I don't want this! It would be much more informative to the user if the graph changed in place, with no change of viewpoint. Is this possible?

回答(1 个)

Yes. You can store the axes view and later restore it to the stored value after updating the plot. See view.
Alternatively, update the plot using low-level functionality (e.g., set(h,'XData',x,'YData',y,'ZData',z)) rather than high-level functions (e.g., plot3(x,y,z)), because low-level functions don't affect the axes, including the axes view.

类别

帮助中心File Exchange 中查找有关 Graphics Performance 的更多信息

产品

版本

R2023b

标签

提问:

Ken
2024-4-1

评论:

2024-4-4

Community Treasure Hunt

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

Start Hunting!

Translated by