Fixed-size text that zooms/scales with a plot?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Ken Purchase
el 2 de Mayo de 2013
1 voto
Walter Roberson
el 24 de Abr. de 2013
0 votos
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 comentario
Ken Purchase
el 25 de Abr. de 2013
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!