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

10 Ansichten (letzte 30 Tage)
Hi,
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?
  2 Kommentare
Johann
Johann am 10 Mai 2019
This solution helped me to get back to the good old exploration toolbar and plot tools icons in Releases 2018b and 2019a.
Matlab2019a_Figure_Icons.JPG
Add this to 'startup.m' file:
%% Reverting to pre 2018b figure exploration
try
if ~verLessThan('matlab','9.5')
% Hide Ax Toolbar:
set(groot,'defaultAxesCreateFcn',@(ax,~)set(ax.Toolbar,'Visible','off'))
% 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), ...
@(h,e)addToolbarExplorationButtons(h)...
})))
end
catch
warning('Something went wrong.');
end
clearvars('icon_PT_show', 'icon_PT_hide');
Simon Tait
Simon Tait am 12 Nov. 2020
Thank you so much for posting this. Added it to my startup.m in matlab 2020b and works great!

Melden Sie sich an, um zu kommentieren.

Antworten (2)

imrankhan ajees
imrankhan ajees am 21 Feb. 2019
customize it again.

Sturla Kvamsdal
Sturla Kvamsdal am 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.
Thanks,
Sturla
  1 Kommentar
Johann
Johann am 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'))

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by