필터 지우기
필터 지우기

error using mouse scroll with zoom on

조회 수: 4 (최근 30일)
Sebastian Roehn
Sebastian Roehn 2016년 3월 8일
편집: Georgy Loginov 2016년 9월 27일
I get the following error message under scrolling the mouse wheel with zoom on:
Error while evaluating Figure WindowScrollWheelFcn
Cell contents reference from a non-cell array object.
Error in matlab.graphics.interaction.hitAxes>removeAxesInOffscreenContainers (line 63)
Error in matlab.graphics.interaction.hitAxes (line 21)
Error in zoom>locFindAxes (line 2502)
Error in zoom>localButtonWheelFcn (line 737)
Error using waitfor
Error while evaluating Figure WindowScrollWheelFcn
The problem is cause by the parent of the axes, in my case an uitab object. If the parent is a figure, it works fine. I defined a figure 'WindowScrollWheelFcn', but the debugger doesn't reach the function. The error comes before.
hfig = figure(...
'WindowScrollWheelFcn',{@figScroll});
Is there a way to get this working on axes within a uitab? Or how can I disable mouse wheel gestures with zoom = on? I use Matlab R2014b.
Thank you for your help!
EDIT - Here is a small example who reproduces the error:
hfig = figure(1);
% Tab group
tabgp = uitabgroup(...
'Parent',hfig,...
'Position',[0 0 1 1]);
Tab1 = uitab(...
'Parent',tabgp,...
'Title','Plot');
axh = axes(...
'Parent',Tab1,...
'Units','normalized',...
'Position',[0.1 0.1 0.8 0.8]);
% plot
plot(axh,1:100,randn(100,1))
zoom(hfig,'on')
uiwait(hfig);

채택된 답변

Mike Garrity
Mike Garrity 2016년 3월 8일
I think that bug's fixed in R2015b.
  댓글 수: 2
Sebastian Roehn
Sebastian Roehn 2016년 3월 8일
Hello, is that just a guess or do you know it (can test it)? I have only the R2014b version. Thank you for your answer.
Mike Garrity
Mike Garrity 2016년 3월 8일
I actually don't use a mouse with a scroll wheel, but I just asked the guy who fixed the bug, and he said R2015b.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Sebastian Roehn
Sebastian Roehn 2016년 3월 11일
Hello Mike, thank you for your feedback. I have found a workaround for previous releases of r2015b.
% get handle
hZoom = zoom;
% define zoom callback for mouse gestures
set(hZoom,'ActionPostCallback',@MouseAction)
I define a callback for mouse clicks/scroll, who will be executed instead of gettting this error.

Georgy Loginov
Georgy Loginov 2016년 9월 27일
편집: Georgy Loginov 2016년 9월 27일
Dear Sebastian, I had the same problem. So the solution of this bug is just crazy. you need at least two axes in the same figure. Try this:
hfig = figure(1);
tabgp = uitabgroup(...
'Parent',hfig,...
'Position',[0 0 1 1]);
Tab1 = uitab(...
'Parent',tabgp,...
'Title','Plot');
axh2 = axes(...
'Parent',Tab1,...
'Units','normalized',...
'Position',[0.1 0.1 0.8 0.8],...
'visible','off');
axh = axes(...
'Parent',Tab1,...
'Units','normalized',...
'Position',[0.1 0.1 0.8 0.8]);
% plot
plot(axh,1:100,randn(100,1))
zoom(hfig,'on')
uiwait(hfig);

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by