0

I want to graph the function f(x,y)=sin(x)sin(y) on the square $[0,2\pi]\times[0,2\pi]$, but only for values that are smaller than some value, for example 0.5.

This is the graph of the whole function on the square: enter image description here

Which I created by using the pgfplots package:

\documentclass{article}
\usepackage[margin=0.25in]{geometry}
\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}

\begin{tikzpicture} \begin{axis}[grid=major] \addplot3[surf,shader=interp,samples=50,domain=0:2pi,y domain=0:2pi {sin(deg(x))*sin(deg(y))}; \end{axis} \end{tikzpicture} \end{document}

I thought that I just can declare that the maximum value of z is 0.5 but this is what I get: enter image description here

I had an idea to define the function to be f(x,y) for values that are less than 0.5, and 5 otherwise, and then to declare the maximum z value to be 1 for example, but I'm not sure how can I define such function.

Can someone please help me with that? Thank you in advance!

Juan Castaño
  • 28,426

0 Answers0