How do I extract coordinates from a plot?

To select a coordinate in a Mathematica plot or two-dimensional graphic, select the graphic, press the Control key and press the left mouse button. A small dot at the position of the mouse pointer and  the coordinates will be displayed in the lower left corner of the Window. To see or use these coordinates, choose Copy from the Edit menu, unselect the graphic, and paste. The coordinates will show up as a Mathematica list in a new input cell.

How can I select multiple points

To select multiple coordinates in a Mathematica plot or two dimensional graphic, select the graphic, press the control key, and click the mouse button 1 over the points yo are interested in. You will see the current coordinates displayed in the lower left corner of the window. To see or use these coordinates, choose Copy from the Edit menu, unselect the graphic, and paste. The coordinates will show up as a Mathematica list in a new input cell. Try this procedure with the plot below. (Move the text cursor between the braces of the ListPlot command after you finish, paste, and evluate the resulting input cell.) You can also select a list of points by holding down the Control key and dragging the mouse.

Plot[Sin[x], {x, -π, π}]

ListPlot[]

You should see something like this.

What can I use this for?

Extracting plot coordinates has  a surprising number of possible uses. Below are some simple examples.

Zooming

Selecting points in a graphic and passing them to the PlotRange option is a very convenient way to enlarge an area of interest in a graphic.

f2[x_] := 
      x^2 - 2*x + (x^2)^(1/4) + 
        12*Sin[x^3]
Plot[Evaluate[f2[x]], {x, -10, 10}];

PlotRange expects the bounds in the form {{(Subscript[x, min]), (Subscript[x, max])}, {(Subscript[y, min]), (Subscript[y, max])}}. Transpose converts the selected points into this form.

Show[%, 
      PlotRange -> 
        Transpose[{{0.839938, 20.7734}, {2.60974, -13.5867}}]]

Finding start points for FindRoot

Selecting points in graphics is also very helpful in finding starting points for numerical solvers like FindRoot.

f2[x_] := 
      x^2 - 2*x + (x^2)^(1/4) + 
        12*Sin[x^3]
Plot[
        x^2 - 2*x + (x^2)^(1/4) + 12*Sin[x^3], {x, -10, 
          10}];

Selecting a point around -1.5 gives the minimum on the negative x-axis.

FindRoot[f2'[x] == 0, {x, 
        First[{-1.55523, 17.305}]}]

Selecting a point to the right of the first maximum of the positive x-axis gives the minimum next to it.

FindRoot[f2'[x] == 0, {x, 
        First[{1.28239, 8.7474}]}]

Selecting pieces of images

The following is an example from the Digital Image Processing application package.

Finally, we show an example of edge detection in a rectangular region of interest using a real image. This loads the example image.

B = ImageRead["lipid.tif"];

Show[Graphics[B]]

Here we define a region-of-interest. To select a particular region, click the displayed graphics object. In Windows (for other systems consult Input/Get Graphics Coordinates ), press the Control key and click a point of interest. The point will be selected. This may be repeated for as many points as desired. use the Copy and Paste command to paste the recorded list of positions to any cell or expression in the notebook. Applying Round converts these values to integers.

roi = 
      Polygon[Reverse /@ 
          Round[{{29.9211, 84.7558}, {126.665, 185.116}, {187.242, 
                49.4942}}]]

This shows the result of applying a Sobel edge detector to the region defined by roi.

Show[
        Graphics[
          RegionProcessing[EdgeMagnitude[#1, N[SobelFilter]] &, B, 
            roi]]];