I have the following scatter plot done with pgfplots:
The meta value of each point represents its "importance", hence red points are more important of blue ones. The problem is that red and orange points are buried among all the blue points, especially around (0,0). Is it possible to draw points with a z-order proportional to their meta value, i.e., having red and orange points in front of the blue ones?
Here's my code:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\pgfplotsset{
ytick={0,0.2,...,1},
xtick={0,0.2,...,1},
xmajorgrids=true,
ymajorgrids=true,
major grid style={dashed},
}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=1,ymin=0,ymax=1,colorbar horizontal]
\addplot[scatter,
only marks,
mark size=1pt,
point meta=explicit,
point meta min={0},
point meta max={100}] table [col sep=comma,
x index=0,
y index=1,
meta index=2] {csv/scatter.csv};
\end{axis}
\end{tikzpicture}
\end{document}
An example scatter.csv:
0.000000,0.000000,53
0.000000,0.000213,1
0.000000,0.007653,1
0.000000,0.017226,1
0.000000,0.030485,1
0.000000,0.032558,1
0.000000,0.034453,1
0.000000,0.039656,1
0.000000,0.050874,1
0.000000,0.061787,1
0.000000,0.065450,1
0.000000,0.151315,1
0.000000,0.184418,1
0.000000,0.201284,1
0.000000,0.217143,1
0.000000,0.250000,4
0.000000,0.255159,1
0.000000,0.257401,1
0.000000,0.268999,1
0.000000,0.331126,1
0.000000,0.333333,3
\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Benedikt Bauer Nov 4 '14 at 14:58datatool
) and plot in the same fashion? – Pouya Nov 4 '14 at 15:10