答案1
当然可以。下面是一个例子。如果你使用编译的话,lualatex
编译速度会更快。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={f(\x,\y)=1+\x*\x+\y*\y;}]
\matrix[column sep=3em]{
\begin{axis}[hide axis,domain=0:1,domain y=0:360,smooth,samples=25,samples y=61]
\addplot3[surf,shader=flat] ({x*cos(y)},{0.8*x*sin(y)},{0});
\addplot3[surf,shader=interp,z buffer=sort] ({x*cos(y)},{0.8*x*sin(y)},{f(x*cos(y),0.8*x*sin(y))});
\end{axis}
&
\begin{axis}[hide axis,domain=0:1,domain y=0:360,smooth,samples=25,samples y=61]
\addplot3[surf,shader=flat] ({x*cos(y)*(2+sin(3*y))},{0.8*x*sin(y)*(2+sin(3*y)},{0});
\addplot3[surf,shader=interp,z buffer=sort] ({x*cos(y)*(2+sin(3*y)},{0.8*x*sin(y)*(2+sin(3*y)},{f(x*cos(y),0.8*x*sin(y))});
\end{axis}\\
};
\end{tikzpicture}
\end{document}
或者具有三角域。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={f(\x,\y)=1+\x*\x+\y*\y;}]
\matrix[column sep=3em]{
\begin{axis}[hide axis,domain=0:1,domain y=0:360,smooth,samples=25,samples y=61,
declare function={myx(\x,\y)=\x*cos(\y);myy(\x,\y)=\x*sin(\y);}]
\addplot3[surf,shader=flat] ({myx(x,y)},{myy(x,y)},{0});
\addplot3[surf,shader=interp,z buffer=sort]
({myx(x,y)},{myy(x,y)},{f(myx(x,y),myy(x,y))});
\end{axis}
&
\begin{axis}[hide axis,domain=-1:1,domain y=0:1,samples=25,samples y=61,
declare function={myx(\x,\y)=\x;myy(\x,\y)=\y*(1-abs(\x));}]
\addplot3[surf,shader=flat] ({myx(x,y)},{myy(x,y)},{0});
\addplot3[surf,shader=interp,z buffer=sort]
({myx(x,y)},{myy(x,y)},{f(myx(x,y),myy(x,y))});
\end{axis}\\
};
\end{tikzpicture}
\end{document}
请注意,您也可以使用过滤器,但边界总体上看起来会有点像素化。