Is it possible to easily disable default interactivity for all axes?

조회 수: 2 (최근 30일)
G. Sparks
G. Sparks 2021년 6월 24일
댓글: G. Sparks 2024년 2월 20일
Previous staff-provided answers indicated that the code snippet
set(groot, 'defaultAxesCreateFcn', @(ax,~) disableDefaultInteractivity(ax))
in startup.m would disable the default interactivity for all axes. This seems simple and practical. However, when using more recent versions of Matlab (e.g. R2020a) this no longer seems to work - the default interactivity will still be active in all figures, even if the axes creation function is adjusted as shown above. The code described here apparently works, but seems like a far more complicated way to achieve the same result. Is there a simpler / more direct way to do this in more recent versions of Matlab?

채택된 답변

Animesh
Animesh 2024년 2월 16일
For R2020b and later versions, the following command can be put in the “startup.m” file to disable the interactivity in plots.
set(groot,'defaultAxesCreateFcn', @(ax,~) set(ax,'Interactions',[]));
  댓글 수: 1
G. Sparks
G. Sparks 2024년 2월 20일
Ah, I think I see part of my problem now - this answer works as desired on standard Matlab plot functions, but I spend a lot of time using a third-party toolbox (MTEX) that has a bunch of custom plotting functions, and it doesn't work on those. Not sure there's a good solution for the latter issue.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by