EDIT:I found a solution. See below.
i'm trying to get something like this:
I have small dots and big dots, and some small dots are connected to one big dot. I can "plot" all points with pgfplots:
\addplot[scatter,
only marks,
point meta=explicit symbolic,
scatter/classes={
a={mark=square*,blue},%
b={mark=triangle*,red},%
d={mark=triangle*,green},%
c={mark=o,draw=black}}]
table[x=xs, y=ys, meta=qs] {test.txt};
\end{axis}
But i can't figure out, how to add the connection between single dots.
I'm looking for something like this:
\foreach \x1/\y1/\x2/\y2 in data{
\draw (\x1,\y1) -- (\x2,\y2);
}
Or is there a better way? Btw: All data are generated by myself, therefore it is no problem to change the format.
EDIT: A MWE
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\addplot[scatter,
only marks,
point meta=explicit symbolic,
scatter/classes={
a={mark=square*,blue},%
b={mark=triangle*,red},%
d={mark=triangle*,green},%
c={mark=o,draw=black}}]
table[x=xs, y=ys, meta=qs] {testoutput.txt};
%add here?
\end{axis}
%or here?
\end{tikzpicture}
\end{document}
with testoutput.txt
xs xs ys qs
155 725 d
195 1215 c
1095 825 c
245 2665 b
395 2850 d
1670 2875 t
15 2660 t
270 1960 t
1715 3010 t
1085 1110 t
1040 685 t
1985 1535 t
580 170 t
2250 2025 t
1815 2925 t
1420 3370 t
160 1125 t
25 500 t
460 640 t
100 70 t
375 170 t
1185 360 t
And then there is an other file connection.dat
155 725 1670 2875
155 725 270 1960
155 725 100 70
155 725 1185 360
1095 825 715 2660
1095 825 1715 3010
1095 825 580 170
It is not sure, which connections i have to made, not until the data is generated.
EDIT2:
\DTLloaddb[noheader=false]{conns}{connections.dat}
\DTLforeach*{conns}{\xA=x, \yA=y, \xB=a, \yB=b}{%
\addplot[
color=gray]
coordinates {
(\xA,\yA )(\xB,\yB)
}; }
But now i have a little perfomance problem. My datas are big: around 1000 dots and ~500 connections per graph! And i need to plot 8 of them. The time to compile my tex is more than 1.5 minutes! Is there a way to "precompile" the graphs?
\x, \y, \a, and \b
(say) because you can't have digits in csnames :)