I have two scatter plots coming from one single csv file.
no,id,x,y,x_proj,y_proj
1,1,565,417,565.6,393.3
1,2,315,234,334.8,193
1,3,949,355,944.8,346.3
I would like to link each point that has the same id. Is there a simple way to do that ?
The code I have so far :
\documentclass{article}
\usepackage{filecontents}
\usepackage{pgfplots}
\begin{document}
\begin{filecontents*}{data.csv}
no,id,x,y,x_proj,y_proj
1,1,565,417,565.6,393.3
1,2,315,234,334.8,193
1,3,949,355,944.8,346.3
\end{filecontents*}
\begin{tikzpicture}
\begin{axis}[
enlargelimits=false,
xmin=0, xmax=1280,
ymin=0, ymax=720,
]
\addplot[
only marks,
scatter,
mark=*,
mark size=2pt]
table[meta index=1, col sep=comma, x=x,y=y]{data.csv};
\addplot[
only marks,
scatter,
mark=*,
mark size=2pt]
table[meta index=1, col sep=comma, x=x_proj,y=y_proj]{data.csv};
\end{axis}
\end{tikzpicture}
\end{document}
Thanks in advance,


