[Tex/LaTex] 3D pgf/tikz; first time making a 3D graph

tikz-pgf

This will be my first 3D graph on LaTeX, and I need help figuring out how to generate the graph of f(x,y)=xye^{x+2y-9x^2-9y^2}. Thank you for your help.

Best Answer

It is as simple as entering the equation and a domain you want to plot it over.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[domain=-1:1,y domain=-1:1]
    \addplot3[surf] {x*y*exp(x+2*y-9*x^2-9*y^2)};
  \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Related Question