Is there a way to disable this?

3 views (last 30 days)
Patrick
Patrick on 4 Jul 2024
Answered: Patrick on 4 Jul 2024
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 Comments
Patrick
Patrick on 4 Jul 2024
Edited: Patrick on 4 Jul 2024
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!

Sign in to comment.

Accepted Answer

Patrick
Patrick on 4 Jul 2024
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.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!