disableDef​aultIntera​ctivity with GeographicAxes bug?

3 次查看(过去 30 天)
I'm trying to stop a GeographicAxes from panning while I interact with it using disableDefaultInteractivity. According to the documentation the target for this function can be an Axes, PolarAxes or GeographicAxes Object
However, the function internally does not accept GeographicAxes:
function disableDefaultInteractivity(ax)
%DISABLEDEFAULTINTERACTIVITY turns off default interactivity
% DISABLEDEFAULTINTERACTIVITY(AXES) turns off default interactivity on
% given axes, uiaxes or polaraxes
% Copyright 2018 The MathWorks, Inc.
narginchk(1,1);
if isa(ax,'matlab.graphics.axis.Axes') || ...
isa(ax,'matlab.ui.control.UIAxes') || ...
isa(ax,'matlab.graphics.axis.PolarAxes')
ax.InteractionContainer.Enabled = 'off';
else
error(message('MATLAB:graphics:interaction:InvalidInputAxes'));
end
It seems the documentation contradicts the implementation: someone switched GeographicAxes for UIAxes. I can manually avoid this function and call:
myAx = geoaxes;
myAx.InteractionContainer.Enabled = 'off';
but I don't think this is the intended implementation. Either the function or the documentation (or both) should be updated.

回答(1 个)

Adam Danz
Adam Danz 2021-5-4
编辑:Adam Danz 2021-5-5
Indeed geo axes are listed as accepted axes in the disableDefaultInteractivity r2019b documentation.
Double check that you're using r19b (type ver in the command window) and if that's confirmed, contact tech support and let us know what they say: Contact Us - MATLAB & Simulink
It's definitely supported in r2021a.

类别

Help CenterFile Exchange 中查找有关 Discrete Data Plots 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by