The Grid goes beyond the graph, as you can see in the screenshot below. What do i have to change, to make the grid align with the graph? It should only be inside the coordinate system.
\usepackage{tkz-euclide}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}
\usetikzlibrary{positioning}
\begin{figure}
\begin{center}
\begin{tikzpicture}
\tkzInit[ymax=6, xmin=-6, ymin=-1]
\tkzGrid[xmax=6, ymax=6]
%\tkzAxeXY
\begin{axis}[
xlabel=x,
ylabel={y}, % max(0, x)
legend pos=north west,
legend cell align=left
]
\addplot[color=blue]{max(0, x)};
\addplot[color=red]{1/(1+exp(-x))};
\addplot[color=green]{(exp(x)-exp(-x))/(exp(x)+exp(-x))};
\addlegendentry{ReLu(x)}
\addlegendentry{sigmoid(x)}
\addlegendentry{tanh(x)}
\end{axis}
\end{tikzpicture}
\caption{Relu und sigmoid function}
\end{center}
\end{figure}
\tkzInit
and\tkzGrid
commands - To add a grid in the axis environment, just add the optiongrid
. If you want to change the axis limits, you can add the options 'xmin=...` in the axis environment. You can read the documentation for more details