フィルターのクリア

How to link cameras for two subplots in a single figure

14 ビュー (過去 30 日間)
Shailen
Shailen 2011 年 7 月 21 日
コメント済み: Alberto Mora 2018 年 5 月 24 日
Hi all,
I draw two subplots in a figure using patch. Now I was wondering if there is a way to link the two cameras together i.e. if I rotate the camera in one of the plots, the other plot in the figure does the same rotation simultaneously (similar to link camera option found in paraview).
Thanks in advance ! Cheers !

回答 (1 件)

Jan
Jan 2011 年 7 月 23 日
ax1 = subplot(1, 2, 1);
pcolor(rand(10));
ax2 = subplot(1, 2, 2);
pcolor(rand(10));
Link = linkprop([ax1, ax2], ...
{'CameraUpVector', 'CameraPosition', 'CameraTarget'}
setappdata(gcf, 'StoreTheLink', Link);
Now rotating one object, acts on the other simultaneously. Perhaps you want to link the 'CameraViewAngle' also.
  1 件のコメント
Alberto Mora
Alberto Mora 2018 年 5 月 24 日
I think that you forgot one bracket at the end of "Link =":
Link = linkprop([ax1, ax2], ...
{'CameraUpVector', 'CameraPosition', 'CameraTarget'});
setappdata(gcf, 'StoreTheLink', Link);
Best

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Support Package for USB Webcams についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by