text out on axes

조회 수: 2 (최근 30일)
Jason
Jason 2014년 10월 10일
답변: Mike Garrity 2014년 10월 10일
I load an image onto an axes and want to display text in the top left hand corner. As I often display the image at different zoom factors, using the text using x,y wont work for all Zoom factors. Is there away to say irrespective of zoom, always plot at a certain coordinate on the underlying axes?
  댓글 수: 1
Jason
Jason 2014년 10월 10일
I will give it a go thanks. Was just wondering if you could text onto an image but use locations from the axes. Thanks IA

댓글을 달려면 로그인하십시오.

채택된 답변

Mike Garrity
Mike Garrity 2014년 10월 10일
Yes, text has a 'Units' property. If you set this to one of the "screen space" units (I just made that term up), then it is relative to the lower-left corner of the axes.
For example:
text(2*72, 1*72, 'My String', 'Units', 'points')
Will create a text string which stays 2 inches in from the left and 1 inch up from the right (a point is 1/72 inch), even when you pan or zoom.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 10월 10일
Can't you just divide the x,y by the zoom factor and text() it with those adjusted coordinates?

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by