1

I was able to customize an online example to my needs, but now I am stuck with the coloring. It would be great, if the function 5*x*sin(2*deg(x)) * y*(1-y) would be in gray-scale and the half-space which so far is yellow -> black.

How can I do this? Thank you in advance.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[grid=major,view={210}{30}, 
         xtick={0,1},
 xticklabels={{1},{0}},
  ytick={0,1},
  yticklabels={{$A$},{$a$}},
   ztick={0,1},
 zticklabels={{0},{$H$}},
    ]
    \addplot3+[mesh,scatter,samples=10,domain=0:1] 
        {5*x*sin(2*deg(x)) * y*(1-y)};

\addplot3 [data cs=cart,surf,domain=0:1,samples=2, opacity=0.5]
      {0.5};        

    \end{axis}
\end{tikzpicture}
\end{document}
2

You can add an appropriate color map.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[grid=major,view={210}{30}, 
         xtick={0,1},
 xticklabels={{1},{0}},
  ytick={0,1},
  yticklabels={{$A$},{$a$}},
   ztick={0,1},
 zticklabels={{0},{$H$}},colormap/blackwhite
    ]
    \addplot3+[mesh,scatter,samples=10,domain=0:1] 
        {5*x*sin(2*deg(x)) * y*(1-y)};

\addplot3 [data cs=cart,surf,domain=0:1,samples=2, opacity=0.5,point meta=0]
      {0.5};        

    \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |

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.