Why is UIAxes default interactivity disabled with WindowScrollWheelFcn?

1 view (last 30 days)
Why do default interactions (pan, zoom, etc.) for UIAxes become disabled when declaring hardware callbacks such as WindowScrollWheelFcn?  To illustrate, compare the behaviors in the following two examples:
%%
f1 = uifigure;
ax1 = uiaxes(f1);
surf(ax1,peaks); %default interactions are enabled
%%
f2 = uifigure;
ax2 = uiaxes(f2);
surf(ax2,peaks);
f2.WindowScrollWheelFcn = 'disp("hello")'; %disables default interactions such as pan, rotate, etc.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Jan 2024
Edited: MathWorks Support Team on 29 Feb 2024
This is currently the expected behavior.  Here are two possible workarounds:
1) Enable the interactions via the axes toolbar ("axtoolbar"), which is available in R2018b and later.  The interactions can be enabled by clicking the desired control in the toolbar.
Please run the below command in the MATLAB R2018b command window to get the release specific documentation with more information about "axtoolbar":
web(fullfile(docroot, 'matlab/ref/axtoolbar.html'))
2) Alternatively, enable the specific interaction programatically, as exemplified below:
%enable pan
pan(ax2, 'on');
%enable rotate
rotate3d(ax2, 'on');
% enable zoom
zoom(ax2, 'on');
Note: This method only allows one interaction (pan, zoom, rotate, etc.) to be enabled at a time.
Please follow the below link to search for the required information regarding the current release:

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!