Fixed-size text that zooms/scales with a plot?
Show older comments
When I add text to a plot using the text() command, it appears at a fixed size, and doesn't change as I zoom into the figure. For example, if I draw a rectangle with text inside it, and zoom out until the rectangle is small, the text stays the same size, and thus us now huge compared to the rectangle. I'd like text that stays put inside the rectangle. I guess this is essentially "rendering" text into a plot.
Is there a way in Matlab or something in the user community that can accomplish this? I have searched and haven't found it yet.
Many thanks. Ken
Accepted Answer
More Answers (2)
Ken Purchase
on 2 May 2013
1 vote
Walter Roberson
on 24 Apr 2013
0 votes
zoom PostAction callback, detect the current axis xlim and ylim, decide on a scaling, and set() the text FontSize appropriately (might as well only do it for the objects that are visible.)
1 Comment
Ken Purchase
on 25 Apr 2013
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!