labelling the (x,y) values corresponding to each data points on a graph
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Athira Surendran
am 29 Mär. 2017
Kommentiert: Athira Surendran
am 29 Mär. 2017
Hi, This is the code for plot. There are around 9 data points. I want the x and y values to be displayed at each point on the curve. For example, at first point, display as '(0,1.0000)', second point, '(15,0.9563)' and so on.
load=[ 0 15 20 25 30 35 40 45 50];
Corr=[ 1.0000 0.9563 0.9419 0.9299 0.9166 0.9152 0.9085 0.8957 0.8881];
[xData, yData] = prepareCurveData( load, corr );
ft = fittype( 'smoothingspline' );
[fitresult, gof] = fit( xData, yData, ft );
figure( 'Name', 'Correlation Coeff Vs Deflection' );
h = plot( fitresult, xData, yData ,'*k');
Thanks in advance
athira
0 Kommentare
Akzeptierte Antwort
KL
am 29 Mär. 2017
Hi Athira,
xOffsets = 0.0025*ones(1,9);
yOffsets = 0.0025*ones(1,9);
for i=1:9
text(load(i)+xOffsets(i), corr(i)+yOffsets(i), [num2str(load(i)) ',' num2str(corr(i))]);
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!