I have a list of some points. I plotted each point and its closest surrounding points.
points = Import[
"/Users/Desktop/100nm12.txt", "Data"];
data = Table[{points[[i]][[1]], points[[i]][[2]]}, {i, 1, Length[points]}]
(*data here is imported in form of x,y coordinates*)
(*I am going to skip the part where I calculate position of each particle and its neighbors.*)
pPar[i_] :=
ListPlot[{data[[i]]}, AspectRatio -> Automatic,
PlotStyle -> Directive[PointSize[0.1], Black],
PlotRange -> {{760, 830}, {0, 700}}]
pNeighbs2[i_] :=
ListPlot[Table[data[[listy[i][[j]]]], {j, 1, Length[listy[i]]}],
AspectRatio -> Automatic,
PlotStyle -> Directive[PointSize[0.1], Red],
PlotRange -> {{data[[i]][[1]] - 20,
data[[i]][[1]] + 20}, {data[[i]][[2]] - 20,
data[[i]][[2]] + 20}}]
(*Here listy is the index of each neighboring point, calculated before*)
Table[Show[pNeighbs2[ii], pPar[ii] ], {ii, 200, 205}]
The result shows like this image,
I want to label each point (both reds and blacks) with its index next to it.