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 Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by