Fixed-size text that zooms/scales with a plot?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (2)
Ken Purchase
il 2 Mag 2013
1 voto
Walter Roberson
il 24 Apr 2013
0 voti
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 Commento
Ken Purchase
il 25 Apr 2013
Categorie
Scopri di più su Annotations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!