I have recently tried to run an old piece of code (written on hg1) on a new version of MATLAB (2015a) that has hg2.
I used to be able to do the following (according to the "gnovice-Amro" method):
function output_txt = customDatatip(~,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'); %// I don't trust gcf ;)
pos = get(event_obj,'Position');
output_txt = {['\lambda: ',num2str(pos(1)*1000,4) 'nm'],...
['T(\lambda): ',num2str(pos(2),4) '%']};
set(findall(hFig, 'Type','text', 'Tag','DataTipMarker'),...
'Interpreter','tex'); %// Change the interpreter
And would get nicely formatted datatip labels with Greek characters.
However, in the new hg2 system, findall
returns a 0x0 empty GraphicsPlaceholder array
, which renders setting the Interpreter
useless.
My question is: How can I set the plot datatip interpreter to (La)TeX in hg2?