Plot image to pgfplots, with the real data

You want to reproduce a plot from another paper in your own document, in your own style, or compare your results against it. Pasting the image looks out of place and cannot be edited. Here is how to get a pgfplots figure with the measured data points instead.

Updated 2026-10-05

Recorded in CatchTeX 0.9: a line plot becomes pgfplots with the measured coordinates.

The quick way

  1. Snip the plot in CatchTeX's PDF viewer (Ctrl+O) or from the screen (Ctrl+Alt+T). Include the axes, tick labels and legend.
  2. Auto mode recognises a plot; you can also pick the Plot chip.
  3. Compare the compiled pgfplots preview with the original snip.
  4. Copy LaTeX (Ctrl+Shift+C): you get a pgfplots axis with one \addplot per series, ready for Overleaf, together with the packages it needs.
\begin{tikzpicture}
\begin{axis}[xlabel={Epoch}, ylabel={Accuracy},
  xmin=0, xmax=50, ymin=0, ymax=1, legend pos=south east]
\addplot coordinates {(0,0.08) (5,0.41) (10,0.66) (20,0.83) (50,0.91)};
\addlegendentry{Ours}
\addplot coordinates {(0,0.07) (5,0.29) (10,0.48) (20,0.66) (50,0.78)};
\addlegendentry{Baseline}
\end{axis}
\end{tikzpicture}

How it measures the data

CatchTeX reads the axis tick labels, maps pixel positions to data values, separates the series and samples each curve. It is deterministic image analysis, not a guess by an AI model, so the same snip always gives the same numbers. On our test set it finds 37 of 38 series, with a mean error of 0.45 % of the axis range, and reads all 40 axis labels.

The data are as precise as the picture: a small, low-resolution plot gives coarser values. Zoom in before you snip, and check the preview against the original.

Other ways, compared

MethodData you can editLaTeX outputEffort
Include the image (\includegraphics)NoPicture only, other fontsNone
WebPlotDigitizer / Engauge DigitizerYes (CSV)No: write the pgfplots code yourselfCalibrate axes, click or trace each series
Ask the authors for the dataYesNoDays, if they answer
CatchTeXYes, in the codeComplete pgfplots figure, compiledOne snip

Tips