# Locating points by selecting points

My goal is to locate points without using slide bars then average point is dynamically plotted. Could I select and locate a point directly without using the slider bar?(I could locate points using Manipulate function and plot average as below. The problem is that If there are more points(say, hundreds), there should be more sliders, which will take up a lot of space, and it will be difficult to know which slider corresponds to the point concerned.I have searched documnt center and I think that Locate function can be used though)

    Manipulate[
NumberLinePlot[{{a, b, c, d, e}, {(a + b + c + d + e)/5}},
PlotStyle -> {Black, Red}, PlotRange -> {0, 4}], {{a, 1.5}, 0,
4}, {{b, 1}, 0, 4}, {{c, 1.2}, 0, 4}, {{d, 1.3}, 0, 4}, {{e, 1.4},
0, 4}]


### 1. DynamicModule + LocatorPane

You can use LocatorPane and add/remove points using Alt + Click as follows:

DynamicModule[{pts = {{0, 1}, {3, 1}}},
LocatorPane[
Dynamic[pts, (pts = #; pts[[All, 2]] = 1;) &],
Dynamic @
NumberLinePlot[{pts[[All, 1]], {Mean[pts[[All, 1]]]}},
PlotStyle -> (Directive[AbsolutePointSize[10], #] & /@ {Black, Red}),
ImageSize -> Large,
PlotRange -> {0, 4},
Appearance -> None,
LocatorAutoCreate -> True]]


Epilog -> {Text[Style[Round[Mean@pts[[All, 1]], .01], 16],
Offset[{10, 0}, {Mean@pts[[All, 1]], 2}], {Left, Center}]}


to get

### 2. Manipulate + Locator

Manipulate[
NumberLinePlot[{pts[[All, 1]], {Mean[pts[[All, 1]]]}},
Epilog -> {Text[Style[Round[Mean@pts[[All, 1]], .01], 16],
Offset[{10, 0}, {Mean@pts[[All, 1]], 2}], {Left, Center}]},
PlotStyle -> (Directive[AbsolutePointSize[10], #] & /@ {Black, Red}),
ImageSize -> Large,
PlotRange -> {0, 4},