# How to configure axis on pgfplots?

How to configure axis on pgfplots? Similar for this.

\documentclass{article}
\usepackage{tikz,pgfplots}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[>=latex]
%x axis
\draw[->] (-5,0) -- (5,0) node[below] {$x$};
\foreach \x in {-4,...,-1,1,2,...,4}
\draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
%y axis
\draw[->] (0,-5) -- (0,5) node[left] {$y$};
\foreach \y in {-4,...,-1,1,2,...,4}
\draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\node[below left] at (0,0) {\footnotesize $0$};
\end{tikzpicture}
\end{document}

-
You need to elaborate on what you mean by "configure"? Do you want to have different labels than numeric values? Do you want to modify the spacing between elements? Or both? Do you want to modify the format of the labels? Do you want to modify the format of the ticks? Or both? Do you want to change the arrows on the axis? Do you want to add arrows? Or both? –  Werner Oct 12 '11 at 20:35
Do you mean something like the plot on page 169 of the version 1.5 manual for sine? –  Joseph Wright Oct 12 '11 at 20:35

\documentclass{article}
\usepackage{tikz,pgfplots}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[>=latex]
\begin{axis}[
axis x line=center,
axis y line=center,
xtick={-5,-4,...,5},
ytick={-5,-4,...,5},
xlabel={$x$},
ylabel={$y$},
xlabel style={below right},
ylabel style={above left},
xmin=-5.5,
xmax=5.5,
ymin=-5.5,
ymax=5.5]