How can I orbit a plot3 via mouse while updating it?
Mostrar comentarios más antiguos
I have a plot that I want to be able to orbit with my mouse while it's updating. But every update to the plot forces the plot to go back to it's default view point. Is there a way to do what I want?
Thanks in advance!
Respuesta aceptada
Más respuestas (1)
2 comentarios
Dereck
el 12 de Sept. de 2014
Geoff Hayes
el 13 de Sept. de 2014
Strange how it slowed down over time. Was it necessary for the set(0, 'CurrentFigure', 1); inside the for loop so that it would repeat again and again?
An alternative to the deleting of the handle is to (perhaps) just replace the data at each iteration
figure(1);
% plot the first set of data outside of loop
h = plot3(X(1,:), Y(1,:), Z(1,:));
for k=2:100000
set(h,'XData',X(k,:),'YData',Y(k,:),'ZData',Z(k,:));
drawnow;
pause(0.1);
end
So we plot the first set (k==1) initially so that we can get the handle to the 3D plot graphics object. And then on each subsequent iteration of the for loop, we just replace the X,Y, and Z data.
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!