\documentclass{standalone}
% translate with >> pdflatex -shell-escape <file>

% This file is an extract of the PGFPLOTS manual, copyright by Christian Feuersaenger.
% 
% Feel free to use it as long as you cite the pgfplots manual properly.
%
% See
%   http://pgfplots.sourceforge.net/pgfplots.pdf
% for the complete manual.
%
% Any required input files (for <plot table> or <plot file> or the table package) can be downloaded
% at
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/
% and
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/plotdata/

\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\pagestyle{empty}

\begin{document}
\begin{tikzpicture}
	\begin{axis}[legend pos=outer north east]
	\addplot3[surf,samples=9,domain=0:1] 
		{(1-abs(2*(x-0.5))) * (1-abs(2*(y-0.5)))};
	\addlegendentry{$\phi_x \phi_y$}

	\addplot3+[ultra thick] coordinates {(0,0,0) (0.5,0,1) (1,0,0)};
	\addlegendentry{$\phi_x $}

	\addplot3+[ultra thick] coordinates {(1,0,0) (1,0.5,1) (1,1,0)};
	\addlegendentry{$\phi_y $}
	\end{axis}
\end{tikzpicture}
\end{document}
