How to label points on a plot based on the data in table (not based on the number of points)?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kasih Ditaningtyas Sari Pratiwi
am 3 Nov. 2017
Kommentiert: Kasih Ditaningtyas Sari Pratiwi
am 4 Nov. 2017
Hi! I have a question regarding labelling points in matlab. I have a figure which needs to be labelled based on the data in the table. I read the example of labelling, but it mostly label based on the number of the points, not the data itself. I attach the picture of the figure and their corresponding label. The 'sampling point' should be labelled based on the data in LabelSamplPoint in cell 16 (I attach the picture of the table). I am confused about how to put the data in cell 16 as the label to the points in the plot. The point itself is from cell 15 for y-axis and the x-axis is cell 1. Could you please help me? Thank you very much for your help.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Nov. 2017
mask = ~isnan(finalCSVnew.LabelSamplPoint);
xvals = finalCSVnew{mask, 1}; %assuming you are right
yvals = finalCSVnew{mask, 15}; %are you sure?? This appears to be SamplError not a y value
labvals = FinalCSVnew.LabelSamplPoint(mask);
text(xvals, yvals, labvals)
3 Kommentare
Walter Roberson
am 3 Nov. 2017
labvals = sprintfc('%g', finalCSVnew.LabelSamplPoint(mask));
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 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!