vsevilla
(Vinicio Sevilla)
1
Hello
I need to labeling the points of my plot, could you help to fix my code please.
labels = {"2501", "2502", "2503", "2510", "2511", "2522", "2524",
"2528", "2539"};
data = {{0.1297, 0.1840}, {0.3612,
0.1240}, {-1.3952, -0.6757}, {-0.9369, 0.1543}, {-0.2940,
0.7242}, {-0.3331, -0.3813}, {0.1715,
0.4654}, {0.4932, -0.4044}, {0.5028, 0.2906}};
Show[
ListPlot[points],
Graphics[Text[#2, #1 + {0, 0.05}] & /@ {points, labels}]
]
Thank a lot
dreiss
(David Reiss)
2
Here is a modification that works (note that I changed your argument to data from points):
Show[ListPlot[data],
Graphics[Text[#[[2]], #[[1]] + {0, 0.05}] & /@
Transpose@{data, labels}]]
and here is a version without needing to use Show:
ListPlot[data,
Epilog -> (Text[#[[2]], #[[1]] + {0, 0.05}] & /@
Transpose@{data, labels})]
vsevilla
(Vinicio Sevilla)
3
Thanks a lot David you save my day
Regards
Vinicio