pos =
0.7535 0.8210 0.1321 0.0797
Gotta' run, sorry...general idea, fix up the width and horizontal position so the text box doesn't overlay the legend; issue is the 'FitToText' property when on adjusts the height to that of the text in the box, not matching the legend height.
See the annotation for the text box for the details on the properties; the place where having the units in normalized figure coordinates actually works because that's how the legend is positioned. OK....back. Let's see if we can clean this up...
hA=annotation('textbox','String','NCD','FitBoxToText','on', ...
'horizontal','right','vertical','middle', ...
'LineStyle','none','Margin',0,'Visible',0);
0.7535 0.8210 0.1321 0.0797
delete(hA)
0.3000 0.3000 0.1000 0.1000
posAn=pos+[-widthAn 0 0 0];
posAn =
0.6535 0.8210 0.1321 0.0797
hA=annotation('textbox',posAn,'String','NCD','FitBoxToText','off', ...
'horizontal','left','vertical','middle', ...
'LineStyle','none','Visible',1);
pos(1)=posAn(1); pos(3)=pos(3)+widthAn;
Well, that's the right idea; just not yet quite right on manipulating the two objects' width and left positions to get the text placed precisely where want within the outline, but it can be done...with a lot of tedium, first, of course.
I gotta' run again...good luck. "Salt to suit!"