I would create a scatter plot using pgfplots using data from my dat file that contains this data:
nodes x y label
1.0000 14.1209 7.0332 a
2.0000 0.6367 16.6166 a
3.0000 5.5385 11.7053 a
4.0000 0.9234 10.9945 a
5.0000 1.9426 18.3439 b
6.0000 16.4692 5.7168 b
7.0000 13.8966 15.1440 a
8.0000 6.3420 15.0746 a
9.0000 19.0044 7.6089 b
10.0000 0.6889 11.3564 b
I would create a scatter plot where the first column is the label of every scatter while the two next colomn are x and y. The last column is a class that decide if the scatter has to be red or blue This is the code I had created
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[xlabel=metri,ylabel=metri]
\addplot[nodes near coords*={\thisrow{nodes}},
scatter/classes={
a={mark=*,blue},
b={mark=*,red}
},
scatter, only marks,
scatter src=explicit symbolic]
table[x=x,y=y,meta=label]
{./MATLAB/grafici/network_map.txt};
\end{axis}
\end{tikzpicture}
\end{figure}
Unfortunately in this way I don't get the label. Something doesn't work