\documentclass{article}
% translate with >> pdflatex -shell-escape <file>

% This file is used as unit test for pgfplots, copyright by Christian Feuersaenger.
% 
% See
%   http://pgfplots.sourceforge.net/pgfplots.pdf
% for pgfplots.
%
% Any required input files (for <plot table> or <plot file> or the table package) can be downloaded
% at
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/
% and
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/plotdata/

\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\pagestyle{empty}

\def\loglogtestplot{
	\addplot plot coordinates {
		(5,	8.311600e-02)
		(17,	2.546856e-02)
		(49,	7.407153e-03)
		(129,	2.101922e-03)
		(321,	5.873530e-04)
		(769,	1.622699e-04)
		(1793,	4.442489e-05)
		(4097,	1.207141e-05)
		(9217,	3.261015e-06)
	};
	\addlegendentry{$d=2$}

	\addplot plot coordinates {
		(7,	8.471784e-02)
		(31,	3.044093e-02)
		(111,	1.022145e-02)
		(351,	3.303463e-03)
		(1023,	1.038865e-03)
		(2815,	3.196465e-04)
		(7423,	9.657898e-05)
		(18943,	2.873391e-05)
		(47103,	8.437499e-06)
	};
	\addlegendentry{$d=3$}
}%

\begin{document}


\begin{tikzpicture}
	\begin{loglogaxis}[ymajorgrids,xmajorgrids]
	\loglogtestplot
	\end{loglogaxis}
\end{tikzpicture}
\end{document}
