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

조회 수: 10 (최근 30일)
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
Johann
Johann 2019년 5월 10일
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 2020년 11월 12일
Thank you so much for posting this. Added it to my startup.m in matlab 2020b and works great!

댓글을 달려면 로그인하십시오.

답변 (2개)

imrankhan ajees
imrankhan ajees 2019년 2월 21일
customize it again.

Sturla Kvamsdal
Sturla Kvamsdal 2019년 9월 5일
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
Johann
Johann 2019년 9월 5일
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'))

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by