ich will gerade mit tikz einen graphen für ne betragsfunktion plotten, doch aus irgendeinem grund macht da gnuplot ziemlichen unsinn:
\begin{tikzpicture}[domain=0:4]
    \def\xmin{-2}
    \def\xmax{4.2}
    \def\ymin{-1}
    \def\ymax{4.2}
% Gitter
    \draw[very thin,color=gray] (\xmin,\ymin) grid (\xmax,\ymax);
% Achsen
    \draw[->] (\xmin,0) -- (\xmax,0) node[right] {\( x \)};
    \draw[->] (0,\ymin) -- (0,\ymax) node[above] {\( f(x) \)};
% Funktionen
    \draw[color=black, domain=\xmin:\xmax] plot[id=test] function{abs(x+1)}
        node[right] {\( f(x) = |x+1| \)};
\end{tikzpicture}
Bei verschachtelten Betragsfunktionen ist das noch extremer...
Hoffe, jemand kann helfen.. Danke


