How to enable rotation context menu when anywhere in the uiaxes plot area is right clicked?

3 次查看(过去 30 天)
I am currently working in App Designer and plotting data with scatter3 which can leave a lot of the plot area empty. When I enable the rotation toolbar and right click over data, the rotation context menu pops up (Restore View, Go to X-Y view...) but when I am not over data and right click that menu does not show up. I get the following warnings:
Warning: Setting the "ContextMenu" property is not permitted while this mode is active.
> In matlab.graphics.interaction.internal/WebAxesModeWarnings/localModeWarn
In matlab.graphics.interaction.internal.WebAxesModeWarnings
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
Warning: Setting the "ContextMenu" property is not permitted while this mode is active.
> In matlab.graphics.interaction.internal/WebAxesModeWarnings/localModeWarn
In matlab.graphics.interaction.internal.WebAxesModeWarnings
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
Warning: Setting the "UIContextMenu" property is not permitted while this mode is active.
> In matlab.graphics.interaction.internal/WebAxesModeWarnings/localModeWarn
In matlab.graphics.interaction.internal.WebAxesModeWarnings
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
Warning: Setting the "ContextMenu" property is not permitted while this mode is active.
> In matlab.graphics.interaction.internal/WebAxesModeWarnings/localModeWarn
In matlab.graphics.interaction.internal.WebAxesModeWarnings
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter
In matlab.graphics.interaction.webmodes.figureModeInteractionOnEnter>@(o,e)restoreAllButtonCallback(hObj,interactionData.PropertyRestoreMap,hFig)
I have tried using a post set listener on the rotation toolbar so that it sets the UIAxes context menu to a duplicate rotation context menu I created. This worked to set the context menu but when the rotation toolbar option was disabled, the UIAxes context menu could not be reset.

回答(1 个)

Rasmita
Rasmita 2023-8-8
Hi,
It is my understanding that you want to enable rotation context menu when right clicked on the blank space of plot area, but you are getting above mentioned warnings while doing that.
There is no current workaround in MATLAB R2023a. This issue has been resolved in the prerelease for MATLAB R2023b.
In MATLAB R2023a, the warning message caused by this issue can be suppressed by executing the following command:
>>warning('off','MATLAB:modes:mode:InvalidPropertySet')
Regards,
Rasmita

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by