Is there a way to disable this?

조회 수: 3 (최근 30일)
Patrick
Patrick 2024년 7월 4일
답변: Patrick 2024년 7월 4일
I don't manipulate my figures any, so I don't need whatever toolbar this is. Also, it's causing MATLAB to generate strange errors, which are annoying but don't actually mean anything important for my program. I'm looking for a way to generate static figures (figures that cannot be panned, zoomed, etc) or at least disabling this toolbar when creating your normal bar graphs.
  댓글 수: 2
Patrick
Patrick 2024년 7월 4일
편집: Patrick 2024년 7월 4일
Not the correct command for this toolbar, but I was able to piecemeal a few other quesions' solutions to make this work out. Thanks though!

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

채택된 답변

Patrick
Patrick 2024년 7월 4일
Sorry to answer my own question (kinda defeats the purpose of asking, in my opinion...).
First off, there are numerous threads saying those pesky graphics errors are for a number of reasons such as naming conflicts (and definitely double check your file names just to be safe!) However, the solutions in those threads (aside from renaming stuff) were to reinstall Windows, which is a bit extreme, and to reinstall MATLAB, which didn't help in this case. The errors only came when I hovered my mouse over the plots' interactive stuff, so that's why I wanted to disable it.
Now for the solution: there's actually two parts: First off, to disable the toolbar itself, type:
set(0,'defaultAxesToolbarVisible','off')
under the figure command. This disables/hides the toolbar itself in every plot or subplot on that figure.
A few errors continue to pop up though. This is because even without the toolbar, a few controls are active on the plots by default. To eliminate that, you type:
disableDefaultInteractivity(gca);
under every plot or subplot you create.
This got rid of all the errors in my case, and since my x-axis limits and y-axis limits are set in code, I just have a nice static window of plots, just how I wanted, with no errors popping up in the command window.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by