How to print the value of refline on a the plot
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sc1991
am 20 Jun. 2018
Kommentiert: sc1991
am 21 Jun. 2018
Hello! All I am using the function refline to show the min,max and mean of my dataset is there a way how I can show the value of these points on the line or at the end of the line. I tried using the function text but that function does not seem to work. Any suggestions??
0 Kommentare
Akzeptierte Antwort
Adam Danz
am 20 Jun. 2018
Why isn't text() working? Here's a demo of what your describing and text() works.
x = normrnd(10,20,1,50);
figure; plot(x, 'o')
rh = refline(0,mean(x));
text(max(xlim),mean(x),sprintf('mean=%.2f',mean(x)),'HorizontalAlignment', 'right', 'VerticalAlignment', 'bottom')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots 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!