5

I am trying to create a plot using pgfplot tool for latex. I want to plot $z=\sin(x)\sin(y)$ to create a plot that looks like enter image description here So am am just imitating the code provided in the picture with the preamble mentioned.

    \begin{frame}
    \begin{tikzpicture}
    \begin{axis}
    \addplot3[surf,domainin=0:360, sample=40, shader=none] 
    {sin(x)*sin(y)};
    \end{axis}
    \end{tikzpicture}
    \end{frame}

But I am getting My result. I know its a problem with scaling but I tried to include ymin, ymax, xmin, xmax values with even disastrous results. I would appreciate any help.

  • 2
    You have domainin instead of domain. – Torbjørn T. Sep 6 '15 at 17:04
  • You should correct the typos and rerun. It works for me. (Except for the shader=none) – Philipp Imhof Sep 6 '15 at 17:05
  • OHHHHHHHHHHHHH sorry yes it's just that I am getting the desired one now. I am sorry for the whole thing, I have been pulling my hairs for last few hours :( – baharampuri Sep 6 '15 at 17:07
  • 1
    You did not wonder what the Package pgfkeys Error: I do not know the key '/tikz/domainin', to which you passed '0:360', and I am going to ignore it. Perhaps you misspelled it. could mean? ;-) – Philipp Imhof Sep 6 '15 at 17:08
  • 1
    Do not mistake this, it is meant to be constructive: This is exactly why we often ask people to put a MWE when posting a question. In many cases, the process of creating a MWE already solves the problem. – Philipp Imhof Sep 6 '15 at 17:29
8

This works (you had domainin and it's domain; you had sample and it's samples, and I suppressed the shader):

\documentclass{beamer} 
\usepackage{pgfplots}

\begin{document}

\begin{frame}
    \begin{tikzpicture}
    \begin{axis}
    \addplot3[surf,domain=0:360, samples=40] 
    {sin(x)*sin(y)};
    \end{axis}
    \end{tikzpicture}
\end{frame}

\end{document}

enter image description here

  • Perfect! Thank you. Is there a way to rotate the plot in a small animation to show the maximums and minimums for the viewers in here? – baharampuri Sep 6 '15 at 17:12
  • @baharampuri You're welcome. That's a completely different issue. Consider opening a fresh new question. – Gonzalo Medina Sep 6 '15 at 17:12
  • Gladly, that's the cue I was looking for! – baharampuri Sep 6 '15 at 17:16

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.