I am struggling with putting three graphs side-by-side in one line. Every solution I could find caused errors because of the usage of axis.
\begin{tikzpicture}
\begin{axis}[
domain=-10:10,
grid=major,
xmin=-10, xmax=10,
ymin=-10, ymax=10,
xlabel={x}, ylabel={y},
samples=1000,
axis y line=center,
axis x line=middle
]
\addplot+[mark=none,color=blue] {1 * abs(x-1) + 0};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
domain=-10:10,
grid=major,
xmin=-10, xmax=10,
ymin=-10, ymax=10,
xlabel={x}, ylabel={y},
samples=1000,
axis y line=center,
axis x line=middle
]
\addplot+[mark=none,color=red] {1 * abs(x-0) + 0};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
domain=-10:10,
grid=major,
xmin=-10, xmax=10,
ymin=-10, ymax=10,
xlabel={x}, ylabel={y},
samples=1000,
axis y line=center,
axis x line=middle
]
\addplot+[mark=none,color=green] {1 * abs(x+1) + 0};
\end{axis}
\end{tikzpicture}

I would like to get these three pictures side-by-side in one line including a caption for each of them + a caption for the whole figure. I tried a lot with figures and subfigures etc., but I always got error messages telling me that something is wrong because of the \begin{axis} part. This is how I would like it to look like:

EDIT: @martijnn2008 reply to your comment
I just tried that: Caption issue when placing figure side by side - but it doesn't work.
\begin{figure}
\centering
\begin{minipage}[t]{.45\textwidth}
\centering
\resizebox{0.2\textwidth}{!}{
\begin{tikzpicture}
\begin{axis}[
domain=-10:10,
grid=major,
xmin=-10, xmax=10,
ymin=-10, ymax=10,
xlabel={x}, ylabel={y},
samples=1000,
axis y line=center,
axis x line=middle
]
\addplot+[mark=none,color=blue] {1 * abs(x-0) + 0};
\end{axis}
\end{tikzpicture}
}
\caption{A not.}
\end{minipage}\hfill
\begin{minipage}[t]{.45\textwidth}
\centering
\resizebox{0.2\textwidth}{!}{
\begin{tikzpicture}
\begin{axis}[
domain=-10:10,
grid=major,
xmin=-10, xmax=10,
ymin=-10, ymax=10,
xlabel={x}, ylabel={y},
samples=1000,
axis y line=center,
axis x line=middle
]
\addplot+[mark=none,color=blue] {1 * abs(x-0) + 0};
\end{axis}
\end{tikzpicture}
}
\caption{A caption.}
\end{minipage}
\caption{Lorem Ipsum dolor sit atmet.}
\end{figure}
As you can see in the image, the two graphs are still not in one row. But we have captions now.

