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)
You can also hide or remove the axes toolbar with the code below:
ax = gca;
ax.Toolbar.Visible = 'off';
ax.Toolbar = [];
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.
Best Answer