I'm trying to modify a surface in pgfplots
to get something similar to a Matlab result. The image below is what I want to achieve.
The code I used:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{colormap/viridis,width=10cm,compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
colormap/viridis,
view={60}{30},
]
\addplot3[
surf,
samples=25,
domain=-3:3,
]
{x^2+4*y^2};
\addlegendentry{\(x^2+4y^2\)}
\end{axis}
\end{tikzpicture}
\end{document}
So basically what I'm trying to do is to remove the bottom of the pgfplots
surface. The ellipse is defined by -2<x<2 and -1<y<1, with center in (0,0).
Best Answer
or with
shader=interp