labelling the (x,y) values corresponding to each data points on a graph
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
KL
2017 年 3 月 29 日
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
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!