Menu

How to turn a plot image into pgfplots with the real data
📰

How to turn a plot image into pgfplots with the real data

DEV Community: tutorial·Chintu Gurbani·5 days ago
#jITC88yb
#devtotutorial#devto#dev#catchtex#plot
Reading 0:00
15s threshold

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.

The quick way

Snip the plot in CatchTeX's PDF viewer (Ctrl+O) or from the screen (Ctrl+Alt+T). Include

the axes, tick labels and legend.

Auto mode recognises a plot; you can also pick the Plot chip.

Compare the compiled pgfplots preview with the original snip.

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}

Enter…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.