# How to add space around graph - pgfplots

This is my code:

\documentclass{article}
\usepackage{tikz, pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle,
xtick={-3,-2,...,3},
ytick={-3,-2,...,3},
ylabel=$y$,
xlabel=$x$,
xlabel style={below right},
ylabel style={above left},
samples=200,
axis equal image
]
\end{axis}
\end{tikzpicture}
\end{document}


In the output, both axes only go from -2 to 2. Is there a way to make both axes go from -3 to 3? I can't alter the domain here, since it's a parametric plot. Thanks for your help.

There are several ways to achieve this. Here I show two of them. Please have a look at the comments in the code.

(In addition I commented some of your code, just in case you are not aware of that stuff.)

% used PGFPlots v1.15
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle,
%--------------------
% (this can be achieved in a simpler way)
%        xtick={-3,-2,...,3},
%        ytick={-3,-2,...,3},
xtick distance=1,
ytick distance=1,
%--------------------
ylabel=$y$,
xlabel=$x$,
xlabel style={below right},
ylabel style={above left},
% (this doesn't do anything, because you have added samples' to the
%        samples=200,
axis equal image,
% ---------------------------------------------------------------------
% either set the axis limits explicitly ...
%        xmin=-3,
%        xmax=3,
%        ymin=-3,
%        ymax=3,
% ... or enlarge the limits relatively or like here absolutely
enlargelimits={abs=1},
% ---------------------------------------------------------------------
]
\end{axis}
\end{tikzpicture}
\end{document}


Just add xmin and xmax etc.

\documentclass{article}
\usepackage{tikz, pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle,
xtick={-3,-2,...,3},
ytick={-3,-2,...,3},
ylabel=$y$,
xlabel=$x$,