uiinspect , "TextBox" matlab.graphics.shape.internal.GraphicsTip obj TipHandle, , , Interpreter! public . :
function output_txt = customDatatip(obj,event_obj)
% Display the position of the data cursor
% obj Currently not used (empty)
% event_obj Handle to event object
% output_txt Data cursor text string (string or cell array of strings).
hFig = ancestor(event_obj.Target,'figure');
pos = get(event_obj,'Position');
output_txt = {['\lambda: ',num2str(pos(1)*1000,4) 'nm'],...
['T(\lambda): ',num2str(pos(2),4) '%']};
if ishg2(hFig)
obj.TipHandle.Interpreter = 'tex';
else %
set(findall(hFig, 'Type','text', 'Tag','DataTipMarker'),...
'Interpreter','tex'); % Change the interpreter
end
function tf = ishg2(fig)
try
tf = ~graphicsversion(fig, 'handlegraphics');
catch
tf = false;
end
:
Edit1:
, MATLAB (.. hg1/hg2), , :
function bool = isGraphicsVersion2
%
%
%
%
%
try
bool = ~matlab.graphics.internal.isGraphicsVersion1;
catch
bool = ~isprop(0,'HideUndocumented');
end