MATLAB: What happened to the figure toolbar? Why is it an axes toolbar? How to put the buttons back

axesfigureMATLABmissingtoolbar

From R2018b onwards, tools such as the zoom, pan, datatip, etc are no longer at the toolbar at the top of the figure window. These buttons are now in an "axes" toolbar and only appear when you hover your mouse over the plot. How do I put the buttons back at the top of the figure window?

Best Answer

From the R2018b release onwards, you can drag-to-pan and scroll-to-zoom in an axes without having to call any MATLAB functions or select any toolbar buttons. Most types of axes include a default set of built-in interactions, but you can customize them by setting the Interactions property of the axes.  For more information about controlling chart interactivity, see the following link:
You can also return the tools to the figure toolbar using the "addToolbarExplorationButtons" function. Please refer to the following code for an example:
surf(peaks)
addToolbarExplorationButtons(gcf) % Adds buttons to figure toolbar
You can also hide or remove the axes toolbar with the code below:
ax = gca;
ax.Toolbar.Visible = 'off'; % Turns off the axes toolbar
%or
ax.Toolbar = []; % Removes axes toolbar data
If you would like to ensure that figures always open with the tools in the toolbar and that axes never contain a toolbar, execute the following code:
>>set(groot,'defaultFigureCreateFcn',@(fig,~)addToolbarExplorationButtons(fig))
Execute the below code if you are using R2018b or R2019a release:
>>set(groot,'defaultAxesCreateFcn',@(ax,~)set(ax.Toolbar,'Visible','off'))
Execute the below code if you are using R2019b and onwards release:
>>set(groot,'defaultAxesToolbarVisible','off')
The above settings will be reset when MATLAB re-starts.  To ensure that these settings are used even after MATLAB re-starts, place the above "set" commands in a 'startup.m' file. The 'startup.m' file, when placed on the MATLAB Path, is run during the program start-up process.  For more information about 'startup.m' files, see the following link:
https://www.mathworks.com/help/matlab/ref/startup.html
UPDATE (8/15/19):
Thank you for all of your comments and proposals about the axes toolbar.
We have heard your feedback and worked with members of the community on ways to improve the axes toolbar experience.  With R2019a we released several enhancements to the axes toolbar, including faster startup time, ability to hover directly over the toolbar to make it visible, and improved performance with dense surface data.  Additionally, with R2018b Update 5 we have made performance improvements to the axes toolbar startup time.  We will continue to develop enhancements to the axes toolbar experience, and would like to thank you again for your feedback to help us improve our products.
 
You can download the latest updates using the following link:https://www.mathworks.com/downloads/web_downloads/