フィルターのクリア

Rotate 3D lines in subplots. How do I use camorbit in subplots ?

4 ビュー (過去 30 日間)
Rodrigo Perea
Rodrigo Perea 2016 年 2 月 10 日
コメント済み: Mike Garrity 2016 年 2 月 11 日
So if I plot a (single) random 3d plot, I can rotate it using the following syntax: %% line3d=randn(20,3); %%Create a line coordinate figure, plot3(line3d(:,1),line3d(:,2),line3d(:,3)); %Plots the line coordinate while true; camorbit(1,-.1,'y'); drawnow; end %Rotates the line as I wanted %%
However, it gets tricky when I get subplots as it only rotates the last (or selected) subplot or if I use a while loop, it doesn't do it simultaneously: %% for ii=1:4 %Initializing the line3d in subplots subplot(2,2,ii); line3d=randn(20,3); figure, plot3(line3d(:,1),line3d(:,2),line3d(:,3)); %Plots the line coordinate end ---> ??? How do I rotate all the subplots now?
%% Any advice on how to re

採用された回答

Mike Garrity
Mike Garrity 2016 年 2 月 10 日
編集済み: Mike Garrity 2016 年 2 月 10 日
Subplot returns a handle to an axes. Camorbit accepts a handle to an axes. So you can connect them together like so:
ax = gobjects(1,4);
for j=1:4
ax(j) = subplot(2,2,j);
surf(peaks)
end
while true
for j=1:numel(ax)
camorbit(ax(j),1,-0.1,'y')
end
drawnow
end

その他の回答 (1 件)

Rodrigo Perea
Rodrigo Perea 2016 年 2 月 11 日
Great, thank you! It does what I wanted but the rendering is slow probably because my subplots contain too much data (or I am using plot3 instead of surf)? Anyhow is there any way I can make the transition smoother? Probably leading a a related question on how to treating all subplots as a single plot? Thanks you though! Rodrigo
  1 件のコメント
Mike Garrity
Mike Garrity 2016 年 2 月 11 日
You might want to look into the "limitrate" option on drawnow. I talked about when it's appropriate in this post on the graphics blog .

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

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by