Tuesday, May 28, 2013

Dot Plots with pgfplots

I did some more tweaking and came up with this:

Much better, huh?  Here's the code... if you use it replace the "\\" with just "\"
\\begin{figure}
\\beginpgfgraphicnamed{dot_test}
% Preamble: \\pgfplotsset{width=7cm,compat=1.8}
\\begin{tikzpicture}
\\begin{axis}[
ymin=-.3,
ytick=\\empty,
x tick label style={major tick length=0pt}
] \\addplot+[only marks,mark=*] plot coordinates
{(0,3) (0,2) (0,1) (0,0) (1,0) (1,1) (1,2) (2,0) (2,1) (2,2) (2,3) (2,4) (3,0) (3,1) (3,2) (3,3) (4,0) (4,1) (4,2)};
\\end{axis}
\\end{tikzpicture}
\\endpgfgraphicnamed
\\end{figure}