I get the following error message under scrolling the mouse wheel with zoom on:
Error while evaluating Figure WindowScrollWheelFcnCell 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 waitforError 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);
Best Answer