multiple plots in one 3D, bug

조회 수: 1 (최근 30일)
Pollok Tim
Pollok Tim 2016년 11월 23일
답변: Walter Roberson 2016년 11월 24일
Hi Community,
I build a GUI with GUIDE and want 2 3D-plots in one axes. My essential Code.
function l1_listbox_Callback
hold on
myplot = plot3(handles.plot3D_axes,X,Y,Z);
I got this in a listbox which choose between different data. There shall be a posibility to get multiple plots at the same time in one axes-object. But described Code only has effect after I used a pan/rotate-uipushtool with default callback on the axes. Without this it just deletes the old plot and shows the new one.
I tried to cheat with rotate(h,direction, alpha), rotate(h,direction,-alpha), to get this miracle effect after a rotation but with no success.
Any idea?

채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 24일
Use the function form of hold() and pass the axes handle.
hold(handles.plot3D_axes,'on')

추가 답변 (1개)

Pollok Tim
Pollok Tim 2016년 11월 24일
Ok, I found the solution myself. This will make it.
function l1_listbox_Callback
% solution
set(gcf,'currentaxes',handles.plot3D_axes);
hold on
myplot = plot3(handles.plot3D_axes,X,Y,Z);

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by