Azzera filtri
Azzera filtri

mouse pan and zoom don't work after simple figure customizations, eg axis vis3d

8 visualizzazioni (ultimi 30 giorni)
Dear MathWorks,
I have R2021b on linux (Pop!OS 21.04, and see below). If I do
figure(); sphere;
the mousewheel zooms and left-button drags to rotate, which is good.
If I then do
axis equal;
I am still able to zoom and rotate. But instead if I do
axis vis3d;
these features disappear. The mouse has no effect. Subsequent clicking of the icons for pan or rotate or zoom allow one of those modes at a time, but unclicking returns to a state without mouse sensitivity.
This seems like a bug. It is certainly very annoying. Is there a command to return to the "mouse-rotate-and-zoom" state?
In 2D I can get similar behavior. Eg
figure(); plot(rand(10)); set(gcf,'MenuBar','none');
puts it in a state without any response to the mouse pan and zoom. This feels like a bug - one should not have to have the menubar to have mouse control.
Thanks so much for looking into this. System details below. Thanks, Alex
My system is standard other than I removed the link
/usr/local/MATLAB/R2021b/sys/os/glnxa64/libstdc++.so.6
in order to get hardware rendering (matlab looks for the system version of this library).
>> ver
-------------------------------------------------------------------------------------------------------------------
MATLAB Version: 9.11.0.1769968 (R2021b)
MATLAB License Number: 40764494
Operating System: Linux 5.11.0-7633-generic #35~1630100930~21.04~ae2753e-Ubuntu SMP Mon Aug 30 18:26:54 UTC x86_64
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------------------------------------
MATLAB Version 9.11 (R2021b)
Chebfun Version 5.7.0
FINUFFT: Flatiron Institute Nonuniform Fast Fou... Version 1.2.0
IMMOPTIBOX Optimization and Data Fitting Toolbox Version 2.2, November 19,
Optimization Toolbox Version 9.2 (R2021b)
Parallel Computing Toolbox Version 7.5 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b)
>> opengl info
Version: '4.6 (Compatibility Profile) Mesa 21.0.1'
Vendor: 'AMD'
Renderer: 'AMD RENOIR (DRM 3.40.0, 5.11.0-7633-generic, LLVM 11.0.1)'
MaxTextureSize: 16384
Visual: 'Visual 0x4fe, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 8 samples)'
Software: 'false'
HardwareSupportLevel: 'full'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {308x1 cell}
MaxFrameBufferSize: 16384

Risposte (1)

Simar
Simar il 28 Nov 2023
Hi Alex,
I understand that you are facing issue with MATLAB interactive graphics features on a Linux operating system and looking for a command or method to return to the default "mouse-rotate-and-zoom" state without having to rely on GUI controls. Please have a look at suggestions below to troubleshoot the issue:
The behavior being describe could be related to the way MATLAB graphics engine handles interactive features with different axis properties. When setting axis vis3d, MATLAB locks the aspect ratio of the plot and disables stretch-to-fill, which might interfere with some interactive mouse controls. Try resetting the axis mode to auto and see if that restores the interactive behavior:
axis auto;
If this does not work, consider toggling the interactive modes programmatically using the following functions:
  • rotate3d on to enable 3D rotation with the mouse.
  • zoom on to enable zooming with the mouse wheel.
  • pan on to enable panning with the mouse.
For example:
figure();
sphere;
rotate3d on; % Enable 3D rotation
zoom on;% Enable zoom
After using axis vis3d, try calling these functions again to see if they re-enable the interactive features.
Regarding the behavior in 2D plots, the absence of a menubar should not affect the ability to pan and zoom with the mouse. If the interactive modes are not working as expected, it could be a system-specific issue, especially since changes have been made to the MATLAB installation (removing the libstdc++.so.6 link). If none of these steps resolve the issue, consider reaching out to the MathWorks Technical Support for further assistance.
Please refer to the following documentation links -
Hope it helps!
Best Regards,
Simar
  1 Commento
Alex Barnett
Alex Barnett il 29 Nov 2023
Dear Simar,
Thanks for trying. However:
axis auto
doesn't have an effect. Thanks for the 3 commands you gave (rotate3d on; zoom on; pan on;). It's always good to have commands to replace interactive mouse-clicks :)
However, they appear to be exclusive, meaning each one resets the others. This is consistent with the pop-up symbols in the top right being highlighted by each ot those 3 commands. The behavior is exactly as if the mouse click had been used, and as I explained in the original post, it doesn't recover the desired state. Specifically, I find no way to recover a "mouse-rotate-and-zoom" state. vis3d is useful (because it fixes the size during rotation), but I can't use it without destroying that nice mouse interactivity. A solution would be to have independent toggles for rotate and zoom, and have the zoom use only mouse wheel.
Re 2D, I tried
pan on;
and
zoom on;
however these act exclusively again; no way to combine them :(
It seems like both 2d and 3d plots have a desirable initial interactive state which, once changed, cannot be recovered - please let me know if that can be done. I'm almost certain it's not my libstdc++ variant. I also tried ``-softwareopengl`` and behavior is the same.
Thanks, Alex

Accedi per commentare.

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by