# Extracting coordinates from a ListLinePlot

I used an iterative method to resolve equations, then i plotted the results using ListLinePlot. Unfortunately, now I need to use some of the data that was plot. I know the X-coordinate, and need to extract the Y one.

Using the list of data that I plot is not an option, knowing that I'm dealing with points that don't necessarily exist in my list.

Is there any function I can use?

• If you can't use the list of plotted points, you can extract them and then interpolate, which will give you Y and function of X. Apr 30, 2015 at 13:16

Perhaps this example could be helpful

llp = ListLinePlot[
Quantity[{0, 3, 6, 8, 10, 11, 11, 16, 20, 22}, "Centimeters"],
AxesLabel -> Automatic];
pts = Cases[llp, Line[x__] :> x, -1]
lp = ListPlot[pts, Joined -> True];
Grid[{{"Plot", "Replot"}, {llp, lp}}]


Extracted points: {{{1., 0.}, {2., 3.}, {3., 6.}, {4., 8.}, {5., 10.}, {6., 11.}, {7., 11.}, {8., 16.}, {9., 20.}, {10., 22.}}}

You can still use the list of data, that you plotted. You just need to Select those. (x, y) pairs you are interested in.

For example:

Select[plotData, MemberQ[xValues, #[[1]] ]& ]


To obtain the plot data, you can use Part on the ListPlot.

plotData=ListPlot[data][[1]]