What is the problem with text and xlim ? Isn't that the type of behavior you need?
plot(1:100,randn(100,1)) text(80,1.5,'text') set(gca,'XLim',[70 100]) % notice that text stays at same point in "data space" but moves in "axis space" text(80,1,'text2'); % new text appears in axis space as well
If I'm wrong, and you want the text to appear at a specific point in your axis space (and not in the data space that text uses), no matter how you scale, you can create a different set of axes for your text:
inset_h = axes('position',[0.5 0.5 0.2 0.2]) set(inset_h,'Color','none'); axis off text(0,0,'text')
source share