aligning text in plots
356 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
how do i move the point label so its aligned right and higher
x = Vb_ev;
y = pH_ev;
plot(x,y,'ro'), text(Vb_ev, pH_ev,'point X')
0 Kommentare
Akzeptierte Antwort
Jan
am 7 Aug. 2013
text(Vb_ev, pH_ev,'Point X', ...
'HorizontalAlignment', 'right', ...
'VerticalAlignment', 'bottom');
4 Kommentare
Jan
am 7 Aug. 2013
Bearbeitet: Jan
am 7 Aug. 2013
See the documentation for all properties: http://www.mathworks.com/help/matlab/ref/text_props.html. You need to set the "Color" property.
SB
am 16 Mär. 2021
Weitere Antworten (2)
Suman Saha
am 7 Aug. 2013
clear all;clc;close all;
x=1:10;y=1:10;
plot(x,y,'ro')
text([1:10]-1.5,[1:10]+1,'Point X')
axis([-1 12 -1 12])
0 Kommentare
David Sanchez
am 7 Aug. 2013
It depends on your plotted data.
text(x,y,'your_text')
will draw your_text in the position (x,y) within your figure. To draw text in upper right corner of your plot,
x = max(x_variable);
y = max(y_variable);
But bear in mind to subtract something from those values in order to place the text within the plot, otherwise it'll be printed just in the top-right corner and you won't be able to see it. For example:
x = max(x_variable)-10;% adapt the subtracted value to your needs
y = max(y_variable)-10;
Siehe auch
Kategorien
Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!