text to annotate figure
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Richard
il 29 Feb 2012
Commentato: Walter Roberson
il 5 Giu 2017
Is it possible to annotate a plot with text without having to specify the x and y coordinates. I know you can use commands like
'VerticalAlignment','top',...
'HorizontalAlignment','right');
after defining the x and y location but I'm producing many figures in a loop so the x and y values are always going to change so I would like something that would allow the text to always be displayed in the top right hand corner of the figure window. Is this possible?
0 Commenti
Risposta accettata
Più risposte (1)
Walter Roberson
il 29 Feb 2012
No, for text() you still need to specify the x and y coordinates. You can, however, always use [1 1] to mean the upper right corner of of the figure, provided that 'Units' is 'normalized'.
2 Commenti
Morgan
il 5 Giu 2017
If you use [1, 1] then the text will appear off the right-hand side of the plot. You would need [1-width,1]. The width is not known before creating the annotation.
Walter Roberson
il 5 Giu 2017
The text will not appear off the side of the plot if you use 'HorizontalAlignment','right'
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!