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

19 views (last 30 days)
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

Accepted Answer

Jan
Jan on 6 Aug 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 Comments
Fabian Gock
Fabian Gock on 6 Aug 2018
Edited: Adam Danz on 9 Mar 2022
I solved it with
linkprop([ax2 ax1], {'View', 'XLim', 'YLim', 'ZLim'})
Thanks :)

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!