How do I link/lock multiple axis so that they all rotate simultaneously?

28 vues (au cours des 30 derniers jours)
Fabian Gock
Fabian Gock le 6 Août 2018
Modifié(e) : Adam Danz le 9 Mar 2022
I have two sets of axis in one figure and I want to use my mouse to 3D-rotate the plots. The Axis are aligned using linkaxes() and ax1.Position = ax2.Position
The problem is, that only one plot is rotating at a time.
I used two axis, because I want a different colormap on each one.
Thanks for any suggestions! -Fabian

Réponse acceptée

Jan
Jan le 6 Août 2018
The 'Position' property is the location relative to the figure. But you want to control the 'CameraPosition', 'CameraTarget', 'CameraUpVector' and 'CameraViewAngle'. Use linkaxes to link them.
  3 commentaires
Fabian Gock
Fabian Gock le 6 Août 2018
Modifié(e) : Adam Danz le 9 Mar 2022
I solved it with
linkprop([ax2 ax1], {'View', 'XLim', 'YLim', 'ZLim'})
Thanks :)
M Carpenter
M Carpenter le 20 Mai 2019
This was very helpful, thank you Fabian and Jan!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by