This is a follow-up question to Plotting a function on a triangular domain using pgfplots.
I am interested in plotting three functions on a triangular domain, specifically
- x*y
- (2*x*x+2*x+2*y*y-2*y)/(2*x-2*y+4)
- x-y+1
on the triangle (-1, -1) -- (-1, 1) -- (1, -1).
Here's what I have:
\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=$x$,ylabel=$y$,small,view={-45}{10},zmin=-1,zmax=1]
\clip (axis cs:-1,-1) -- (axis cs:-1,1) -- (axis cs:1,-1) -- cycle;
\addplot3[surf,color=gray,domain=-1:1,domain y=-1:1,faceted color=black,opacity=0.05] {x*y};
\addplot3[surf,color=red,domain=-1:1,domain y=-1:1,faceted color=red,opacity=0.05] {(2*x*x+2*x+2*y*y-2*y)/(2*x-2*y+4)};
\addplot3[surf,color=blue,domain=-1:1,domain y=-1:1,faceted color=blue,opacity=0.05] {x-y+1};
\end{axis}
\end{tikzpicture}
\end{document}
As you can see, you cannot see anything :) If I change
view={-45}{10}
to
view={0}{90}
you can see the plots. However, with the aforementioned view, you cannot. Why is that?
Cheers

