MATLAB Answers

Customizing the Matlab figure appearance in Release 2018b - How to bring back plot browser icon, zoom icon etc.?

106 views (last 30 days)
Johann on 21 Feb 2019
Commented: Johann on 5 Sep 2019
in my workflow, I need the plot browser very often. Mainly, to easily enable und disable visibility of single/multiple plots while exploring my data. Having to go first to the 'view' menu and then to look for the 'plot browser' needs more clicks and considerably more time than it was with the plot browser icon in the preveaous releases of Matlab. That is very annoying.
The same applies to the toolbar for the zoom icon, datapoints icon etc. Since Release 2018b I have to wait for the fading in animation of the toolbar icons. This is very annoying and slows me down (e.g. when I just need the zoom-tool to enable the zoomfunction that is restricted only to x- or y- axes).
I know, there are some tricky hacks using the 'startup.m' file to customize some appearances of the matlab figure toolbar. This workaround does not always work and maybe needs the knowledge of a mathworks developer. I don't have that knowledge. I would be thankful, if mathworks would provide a patch/update that allows users to easily customize the matlab figure toolbars, icons, etc. like it is in other programms, for example in 'MS Visual Studio'.
Customziablitity would be great, but for now, does anybody knows how to bring back the plot browser icon?

  1 Comment

Johann on 10 May 2019
This solution helped me to get back to the good old exploration toolbar and plot tools icons in Releases 2018b and 2019a.
Add this to 'startup.m' file:
%% Reverting to pre 2018b figure exploration
if ~verLessThan('matlab','9.5')
% Hide Ax Toolbar:
% Preparing the PlotTools icons:
icon_PT_show = double(imread(fullfile(matlabroot,'toolbox','matlab','icons','tool_plottools_show.png')))/2^16;
icon_PT_show(icon_PT_show==0)=NaN; %Adjust Transparency in icon
icon_PT_hide= double(imread(fullfile(matlabroot,'toolbox','matlab','icons','tool_plottools_hide.png')))/2^16;
icon_PT_hide(icon_PT_hide==0)=NaN;%Adjust Transparency in icon
% Reverting the
%1. 'Hide Plot Tools' icon;
%2. 'Show Plot Tools' icon;
%3. Icons of the pre 2018b toolbar
set(groot,'defaultFigureCreateFcn',@(h,e)(cellfun(@(x)feval(x,h,e), ...
@(h,e) uipushtool(findall(gcf, 'type', 'uitoolbar'),'TooltipString','Hide Plot Tools','ClickedCallback',...
@(x,y) plottools('off'),'CData',icon_PT_hide), ...
@(h,e)uipushtool(findall(gcf, 'type', 'uitoolbar'),'TooltipString','Show Plot Tools','ClickedCallback',...
@(x,y) plottools('on'),'CData',icon_PT_show), ...
warning('Something went wrong.');
clearvars('icon_PT_show', 'icon_PT_hide');

Sign in to comment.

Answers (2)

Sturla Kvamsdal
Sturla Kvamsdal on 5 Sep 2019
This looks promising. What part restores only the plot tools buttons? I am quite happy with having the navigation-stuff by the axis.

  1 Comment

Johann on 5 Sep 2019
In order to restore the navigation-stuff at the axis, just delete or comment this one line and make a restart of matlab:
>> set(groot,'defaultAxesCreateFcn',@(ax,~)set(ax.Toolbar,'Visible','off'))
Instead of restart, you can also enable the navigation at the axis by executing this line once:
>> set(groot,'defaultAxesCreateFcn',@(ax,~)set(ax.Toolbar,'Visible','on'))

Sign in to comment.

Sign in to answer this question.