Why does zoom unexpectedly invert sometimes? (App Designer, UIFigures)
Hello there!
Sometimes I find the plot zoom behaviour is inverted in my UIFigures. If "zoom in" is active (the "zoom in" symbol in the toolbar is active), it would actually zoom out when clicking in the plot and vice versa. Also, in this case, it is not possible to zoom into only one individual axis.
Unfortunately, this bug is not really reproducable, for it seems to happen out of the blue while using my app.
Similarly, the bug sometimes resolves itself and sometimes I am forced to reopen my app to solve it.
There are no Warnings or Errors.
I work with app designer but create the toolbar for the UIFigure myself, in order to define my own callbacks. Also I have 3 axes which have the xAxis linked:
toolbarButtons = {‘export’, ‘datacursor’, ‘pan’, ‘zoomin’, ‘zoomout’, ‘restoreview’};
enableLegacyExplorationModes(app.MyUIFigure);
% Toolbar Axis 1
app.axesOne.Toolbar = axtoolbar(app.axesOne, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn = findall(app.axesOne.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn.ButtonPushedFcn = @app.restoreView;
% Toolbar Axis 2
app.axesTwo.Toolbar = axtoolbar(app.axesTwo, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn(2) = findall(app.axesTwo.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn(2).ButtonPushedFcn = @app.restoreView;
% Toolbar Axis 3
app.axesThree.Toolbar = axtoolbar(app.axesThree, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn(3) = findall(app.axesThree.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn(3).ButtonPushedFcn = @app.restoreView;
% Pan Callback
app.panHandle = pan(app.MyUIFigure);
app.panHandle.ActionPreCallback = @app.panPreCallback;
app.panHandle.ActionPostCallback = @app.panPostCallback;
% Zoom Callback
app.zoomHandle = zoom(app.MyUIFigure);
app.zoomHandle.ActionPreCallback = @app.zoomPreCallback;
app.zoomHandle.ActionPostCallback = @app.zoomPostCallback;
% Linking
linkaxes([app.axesOne, app.axesTwo, app.axesThree], ‘x’);
I already verified, the active toolbar symbol alway reflects correctly in zoom.Direction. So the mess-up must be somewhere elese:
temp = zoom(app.MyUIFigure)
temp =
zoom with properties:
Motion: ‘both’
Direction: ‘in’
RightClickAction: ‘PostContextMenu’
ContextMenu: []
ButtonDownFilter: []
ActionPreCallback: @(varargin)app.zoomPreCallback(varargin{:})
ActionPostCallback: @(varargin)app.zoomPostCallback(varargin{:})
Enable: ‘off’
FigureHandle: [1×1 Figure]
UseLegacyExplorationModes: on
Hopefully somebody can point me in the right direction to resolve this mistery. Thanks a lot in advance for any help.Hello there!
Sometimes I find the plot zoom behaviour is inverted in my UIFigures. If "zoom in" is active (the "zoom in" symbol in the toolbar is active), it would actually zoom out when clicking in the plot and vice versa. Also, in this case, it is not possible to zoom into only one individual axis.
Unfortunately, this bug is not really reproducable, for it seems to happen out of the blue while using my app.
Similarly, the bug sometimes resolves itself and sometimes I am forced to reopen my app to solve it.
There are no Warnings or Errors.
I work with app designer but create the toolbar for the UIFigure myself, in order to define my own callbacks. Also I have 3 axes which have the xAxis linked:
toolbarButtons = {‘export’, ‘datacursor’, ‘pan’, ‘zoomin’, ‘zoomout’, ‘restoreview’};
enableLegacyExplorationModes(app.MyUIFigure);
% Toolbar Axis 1
app.axesOne.Toolbar = axtoolbar(app.axesOne, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn = findall(app.axesOne.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn.ButtonPushedFcn = @app.restoreView;
% Toolbar Axis 2
app.axesTwo.Toolbar = axtoolbar(app.axesTwo, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn(2) = findall(app.axesTwo.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn(2).ButtonPushedFcn = @app.restoreView;
% Toolbar Axis 3
app.axesThree.Toolbar = axtoolbar(app.axesThree, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn(3) = findall(app.axesThree.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn(3).ButtonPushedFcn = @app.restoreView;
% Pan Callback
app.panHandle = pan(app.MyUIFigure);
app.panHandle.ActionPreCallback = @app.panPreCallback;
app.panHandle.ActionPostCallback = @app.panPostCallback;
% Zoom Callback
app.zoomHandle = zoom(app.MyUIFigure);
app.zoomHandle.ActionPreCallback = @app.zoomPreCallback;
app.zoomHandle.ActionPostCallback = @app.zoomPostCallback;
% Linking
linkaxes([app.axesOne, app.axesTwo, app.axesThree], ‘x’);
I already verified, the active toolbar symbol alway reflects correctly in zoom.Direction. So the mess-up must be somewhere elese:
temp = zoom(app.MyUIFigure)
temp =
zoom with properties:
Motion: ‘both’
Direction: ‘in’
RightClickAction: ‘PostContextMenu’
ContextMenu: []
ButtonDownFilter: []
ActionPreCallback: @(varargin)app.zoomPreCallback(varargin{:})
ActionPostCallback: @(varargin)app.zoomPostCallback(varargin{:})
Enable: ‘off’
FigureHandle: [1×1 Figure]
UseLegacyExplorationModes: on
Hopefully somebody can point me in the right direction to resolve this mistery. Thanks a lot in advance for any help. Hello there!
Sometimes I find the plot zoom behaviour is inverted in my UIFigures. If "zoom in" is active (the "zoom in" symbol in the toolbar is active), it would actually zoom out when clicking in the plot and vice versa. Also, in this case, it is not possible to zoom into only one individual axis.
Unfortunately, this bug is not really reproducable, for it seems to happen out of the blue while using my app.
Similarly, the bug sometimes resolves itself and sometimes I am forced to reopen my app to solve it.
There are no Warnings or Errors.
I work with app designer but create the toolbar for the UIFigure myself, in order to define my own callbacks. Also I have 3 axes which have the xAxis linked:
toolbarButtons = {‘export’, ‘datacursor’, ‘pan’, ‘zoomin’, ‘zoomout’, ‘restoreview’};
enableLegacyExplorationModes(app.MyUIFigure);
% Toolbar Axis 1
app.axesOne.Toolbar = axtoolbar(app.axesOne, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn = findall(app.axesOne.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn.ButtonPushedFcn = @app.restoreView;
% Toolbar Axis 2
app.axesTwo.Toolbar = axtoolbar(app.axesTwo, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn(2) = findall(app.axesTwo.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn(2).ButtonPushedFcn = @app.restoreView;
% Toolbar Axis 3
app.axesThree.Toolbar = axtoolbar(app.axesThree, toolbarButtons, ‘Visible’, ‘off’);
app.restoreViewBtn(3) = findall(app.axesThree.Toolbar, ‘Tooltip’,’Restore View’);
app.restoreViewBtn(3).ButtonPushedFcn = @app.restoreView;
% Pan Callback
app.panHandle = pan(app.MyUIFigure);
app.panHandle.ActionPreCallback = @app.panPreCallback;
app.panHandle.ActionPostCallback = @app.panPostCallback;
% Zoom Callback
app.zoomHandle = zoom(app.MyUIFigure);
app.zoomHandle.ActionPreCallback = @app.zoomPreCallback;
app.zoomHandle.ActionPostCallback = @app.zoomPostCallback;
% Linking
linkaxes([app.axesOne, app.axesTwo, app.axesThree], ‘x’);
I already verified, the active toolbar symbol alway reflects correctly in zoom.Direction. So the mess-up must be somewhere elese:
temp = zoom(app.MyUIFigure)
temp =
zoom with properties:
Motion: ‘both’
Direction: ‘in’
RightClickAction: ‘PostContextMenu’
ContextMenu: []
ButtonDownFilter: []
ActionPreCallback: @(varargin)app.zoomPreCallback(varargin{:})
ActionPostCallback: @(varargin)app.zoomPostCallback(varargin{:})
Enable: ‘off’
FigureHandle: [1×1 Figure]
UseLegacyExplorationModes: on
Hopefully somebody can point me in the right direction to resolve this mistery. Thanks a lot in advance for any help. zoom, inverted, broken, uifigure, app designer, random, plot MATLAB Answers — New Questions