3

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.

  • 1
    texdoc.net/texmf-dist/doc/latex/pgfplots/pgfplots.pdf look at the example on page 118. – Torbjørn T. Jun 25 '16 at 6:17
  • 1
    Good to hear. Note that you may have a different version of the pgfplots package on your system, so some details may behave differently from what is described in that PDF. Usually you will be able to get the manual of your installed version by writing texdoc pgfplots and hitting enter in either the start menu search field (Windows), or in a terminal/command line (OS X/Linux). This applies for all packages of course. – Torbjørn T. Jun 25 '16 at 7:40
5

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.