Just for completeness, here's a way to control the radius of the plot marks in PGFplots. In general, scatter
allows control over the individual plot marks, and scatter src
is used to determine where the data for parametrising the marks comes from. scatter src=explicit
means that the data is provided in an additional column.
The @pre marker code
is code that is executed just before each marker, and can be used to set the radius of the markers. In order to specify the radius in the same units as the rest of the plot, you have to convert "meta data" to scaled axis units using \pgfplotstransformcoordinatex
and multiply the result by the length of the unit vector, \pgfplotsunitxlength
.
\documentclass{article}
\usepackage{pgfplots, filecontents}
\begin{filecontents}{data.dat}
# x y r
1 1 1
3 2 0.5
6 3 2
\end{filecontents}
\makeatletter
\begin{document}
\begin{tikzpicture}
\begin{axis}[scatter,
scatter src=explicit,
axis equal,
only marks,
grid=both,
width=10cm,
xmin=0, xmax=8,
scatter/@pre marker code/.code={%
\pgfplotstransformcoordinatex{\pgfplotspointmeta}%
\scope[mark size=\pgfplotsunitxlength*\pgfmathresult]
}
]
\addplot file {data.dat};
\end{axis}
\end{tikzpicture}
\end{document}
