Zooming in and out on a 2D plot [duplicate]

I made a simple 2D plot, but I can't zoom in-out on the figure. I tried many ways. But none gave any results.

Click anywhere + drag the mouse zooms in/out on the point where the mouse was clicked. Ctrl + drag toggles zooming rectangle (from Szabolcs). Shift + drag pans the plot (from Heike). Alt shows coordinates (only when over the plot so that other global Alt-functionality (like Alt+C+L to remove output) can be still used). *) Double click anywhere resets the plot (from kguler). Resize handler at bottom right corner to manipulate ImageSize (does not change aspect ratio). Ctrl + resize also changes aspect ratio.".

I attach a picture shows that it is impossible to zoom in and out.

.

• You could use PlotRange to choose what part of the image you want to see. – bill s Sep 7 '17 at 23:42

The graphics interactions you quote only apply to 3D plots. 2D plot's do not have such support built-in. But do not dispair, Heike's answer here can easily be adapted to your list plot.

SeedRandom[2];
data = Accumulate /@ RandomReal[{-1., 1.}, {3, 250}];
DynamicModule[{range, ref, range0, fac = 2/3},
range = range0 = {{0, 250}, MinMax[data]};
EventHandler[
Dynamic @
ListLinePlot[data,
PlotRange -> range,
Filling -> Axis,
ImageSize -> Large],
{"MouseDown" :>
(ref = MousePosition["GraphicsImageScaled"];
range0 = range),
"MouseDragged" :>
(* pan *)
(range =
range0 +
(ref - MousePosition["GraphicsImageScaled"])
(range0[[All, 2]] - range0[[All, 1]])),
"MouseClicked" :>
Which[
(* zoom in *)
CurrentValue["AltKey"], (* Cmnd on OS X *)
range =
(range - MousePosition["Graphics"])*fac + MousePosition["Graphics"],
(* zoom out *)
CurrentValue["ShiftKey"],
range =
(range - MousePosition["Graphics"])/fac + MousePosition["Graphics"]]}]]


When first evaluated it looks like this.

After paning and zooming it can look like this.