Checking pgfplot for the addplot3-command was easy! I've found this very nice possibility to plot a plane:
\begin{tikzpicture}
\begin{axis}
\addplot3[
surf,
mesh,
]
{x+y+1};
\end{axis}
\end{tikzpicture}
But to emphasize the meaning of the gradient vector I would like to add a vector (1,1,0). Furthermore I need labels for my coordinate system. And how can I add points, e.g. "the origin", to indicate that the functions returns 1 for x=y=0? Thanks for advice.
Here is a specification of the underlying problem: adding a circle or vector refers to the invisible 2d-coordinate system but not to the one plotted.
\begin{tikzpicture}
\begin{axis}
\addplot3[
surf,
mesh,
]
{x+y+1};
\end{axis}
\draw[->] (1,1,0) -- (2,2,0);
\draw (0,0,1) circle (10pt);
\end{tikzpicture}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
xlabel={$x$},
ylabel={$y$}]
\addplot3[
surf, mesh
]
{x+y+1};
\draw[->, ultra thick] (0,0,0) -- (1,1,0);
\fill[red] (0,0,0) circle (2pt);
\draw[->] (1,1,0) -- (2,2,0);
\end{axis}
\end{tikzpicture}
\end{center}
Of course I just mixed up the environment of the addplot3 with the axis environment and possible other subsequent elements. Everythings fine now.
\draw[->] (0,0,0) -- (1,1,0)
\draw
commands inside theaxis
environment, and you need to set\pgfplotsset{compat=1.12}
or use(axis cs:0,0,0)
instead of(0,0,0)
.\pgfplotsset{compat=1.13}
in the preamble (and I would recommend to use 1.13 which is the most recent version, unless you have a compelling reason to use an older version)