AxesToolBar is not Responding for two axes on top of each other.
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I am trying to write a code in which a switch button changes the axes on a figure where each axes contains mesh. I am currently doing it by setting the Visible property of axes and its children to off in callback of switch button. My code is below
f =figure;
uicontrol(f,'Style','pushbutton','String','Switch','Callback',@temp)
ax(1) = axes(f);
mesh(ax(1),rand(10,10),'Visible','off'),title('Plot 1')
ax(1).Visible = 'off';
ax(2) = axes(f);
mesh(ax(2),rand(10,10)),title('Plot 2')
function temp(obj,~)
ax = findobj(obj.Parent,'Type','Axes');
for i=1:length(ax)
if(strcmp(ax(i).Visible,'on'))
ax(i).Visible='off';
ax(i).Children.Visible = 'off';
else
ax(i).Visible='on';
ax(i).Children.Visible = 'on';
end
end
end
Initial figure
After Switch is pressed
The problem i am encountering is with the axes Tool bar. For example i select rotate3d. when i rotate Plot 2 it works perfectly, but i try to rotate Plot 1 after switching it is not rotating. (Built in interactions of axes are working though).
Assuming ax(1) is Plot 1 and ax(2) is Plot 2, i tried to set toolbar visibility of ax(2) to off but it is still not working.
Regards,
M.SAAD
댓글 수: 2
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!