\documentclass[a4paper]{article}
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{ifpdf}
\usepackage{listings}
\usepackage{courier}
\lstset{%
	basicstyle=\ttfamily,
	language=[LaTeX]tex, % Seems as if \lstset{language=tex} must be invoked BEFORE loading tikz!?
	tabsize=4,
	breaklines=true,
	breakindent=0pt
}

\ifpdf
	\usepackage[pdftex]{hyperref}
	\pdfinfo {
		/Author	(Christian Feuersaenger)
	}

\else
	\usepackage[dvipdfm]{hyperref}
	\def\pgfsysdriver{pgfsys-dvipdfm.def}
\fi
%\def\pgfsysdriver{pgfsys-pdftex.def}
\usepackage{pgfplots}

\def\smallplotstest{%
\addplot[smooth,blue,mark=*] plot coordinates {
	(-1,	1)
	(-0.75,	0.5625)
	(-0.5,	0.25)
	(-0.25,	0.0625)
	(0,		0)
	(0.25,	0.0625)
	(0.5,	0.25)
	(0.75,	0.5625)
	(1,		1)
};
}

\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$}
}%

\author{Christian Feuers\"anger}
\title{Tests for pgfplots.sty}

\begin{document}
\maketitle

\begin{tikzpicture}
\begin{axis}
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[width=5cm]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[width=\textwidth]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[height=\textheight,width=\textwidth]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[
	xtick={-1.5,-1,...,1.5},
	ytick={-0.5,0,...,1.5},
	]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[
	xmin=0,xmax=1,
	xtick={-1.5,-1.25,...,1.5}]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[
	enlargelimits=false,
	xmin=0,xmax=1,
	xtick={-1.5,-1.25,...,1.5}]
\smallplotstest
\end{axis}
\end{tikzpicture}

{
\tikzstyle{every axis label}=[]
\tikzstyle{every axis x label}=[
    at={(0.5,1)},
    above,
    yshift=+15pt]
\tikzstyle{every axis y label}=[
    at={(1,0.5)},
    xshift=+15pt,
    rotate=90]

\begin{tikzpicture}
\begin{axis}[
	xlabel=$x$ axis,
	ylabel=$y$ axis,
	xmin=0,xmax=1,
	tickpos=right,
	xtick={-1.5,-1.25,...,1.5}]
\smallplotstest
\end{axis}
\end{tikzpicture}
}

\begin{tikzpicture}
\begin{axis}[
	xlabel=$x$ axis,
	ylabel=$y$ axis,
	xmin=0,xmax=1,
	tickpos=both,
	xtick={-1.5,-1.25,...,1.5}]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[
	xtick={-1.5,-1,...,1.5},
	xticklabel={%
		\ifcase\ticknum	$-1\frac12$%
		\or				$-1$%
		\or				$-\frac12$%
		\or				$0$%
		\or				$\frac12$%
		\or				$1$%
		\or				$1\frac12$%
		\else			$\tick$%
		\fi
	}
]
\smallplotstest
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{loglogaxis}
\loglogtestplot
\end{loglogaxis}
\end{tikzpicture}

\hrule
\nobreak
\vskip10pt
\nobreak
\noindent
\begin{tikzpicture}
\begin{loglogaxis}[width=\textwidth]
\loglogtestplot
\end{loglogaxis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{loglogaxis}[width=\textwidth,height=\textheight]
\loglogtestplot
\end{loglogaxis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{loglogaxis}[height=5.5cm]
\loglogtestplot
\end{loglogaxis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{loglogaxis}[
	xmin=0.99e2,xmax=1e4,
	ytickten={-5,-4,-3.6,-3,-2,-1,0},
	yticklabel={
		\ifnum\ticknum=2	
			$\rightarrow$
		\else
			\axisdefaultticklabellog
		\fi
	}
]
\loglogtestplot
\end{loglogaxis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{loglogaxis}[title=A test title,xlabel=Dof,ylabel=Error]
\loglogtestplot
\end{loglogaxis}
\end{tikzpicture}
\bibliographystyle{gerabbrv} %gerapali} %gerabbrv} %gerunsrt.bst} %gerabbrv}% gerplain}
% \bibliography{literatur.bib}
\end{document}


