I present here just "a bit improved" version of Peter Grill's answer taking in account the suggestions I made in the comment below Peter's answer and a bit more to show some more possibilities of the pgfplots
package ...
Please have a look at the comments in the code for more details.
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{
% use this `compat' level or higher so you don't have to put `axis cs:'
% in front of every TikZ (not PGFPlots) coordinate
% (in this example the coordinates of the rectangle)
compat=1.11,
% declare a variable to only have one place where to change the
% symmetric axis limits
/tikz/declare function={
AxisLimit=1.5;
},
% define a custom layer set, so the *axis labels* are drawn on top of
% the draw/plot commands, which otherwise would be partially hidden
% for this example
% (I just used the default set and moved `axis tick labels' after `main')
layers/tick labels on top/.define layer set={
axis background,axis grid,axis ticks,axis lines,
main,axis tick labels,axis descriptions,axis foreground
}{/pgfplots/layers/standard},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
% don't use a boxed axis but centered lines
% (`center' is an alias for `middle')
axis lines=middle,
% apply the axis limits with the help of the defined variable
xmin=-AxisLimit, xmax=AxisLimit,
ymin=-AxisLimit, ymax=AxisLimit,
% to have equal vector length for both axis ...
axis equal image=true,
% show some minor ticks
minor tick num=4,
% show a grid for both of the ticks (major and minor)
grid=both,
% apply the above created layer set
set layers=tick labels on top,
% in case that only isn't enough you could modify the style of the
% tick labels to have a white background
% (which in addition could be a bit transparent)
tick label style={
fill=white,
fill opacity=0.75,
% (but of course the text should not be transparent)
text opacity=1,
},
]
% you could either draw a rectangle using a TikZ command ...
\draw [
blue,
ultra thick,
] (-1,-1) rectangle (1,1);
% ... or by using a PGFPlots command
\addplot [
mark=none,
red,
thick,
] coordinates {
(-1,-1) (1,-1) (1,1) (-1,1)
}
% use this TikZ command to connect the last with the first
% path element
-- cycle;
\end{axis}
\end{tikzpicture}
\end{document}
