I am trying to annotate a polar plot with data hints labeled "R: ..., Theta: ...", where theta is actually a Greek symbol, not a word. I am familiar with string formatting using "\ theta", as a result of which a character appears, but in this case it does not work. Is there a way to apply the LaTeX interpreter to data tips? Here is what I still have:
f1=figure;
t=pi/4;
r=1;
polar(t,r,'.');
dcm_obj = datacursormode(f1);
set(dcm_obj,'UpdateFcn',@polarlabel)
info_struct = getCursorInfo(dcm_obj);
datacursormode on
where the polar label is defined as follows:
function txt = polarlabel(empt,event_obj)
pos = get(event_obj,'Position');
x=pos(1);
y=pos(2);
[th,r]=cart2pol(x,y);
txt = {['R: ',num2str(r)],...
['\Theta: ',num2str(th*180/pi)]};
source
share