Suppose I would like to draw some surface plot of function which includes singularities and therefore values in infinity (for example 1/(x²+y²)). This topic was already discussed on TeX SE (see).
Here is MWE:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}[grid=both,restrict z to domain*=0:10]
\addplot3 [surf,samples=71,
domain=-2:2,miter limit=1] {1 / (x^2 + y^2)};
\end{axis}
\end{tikzpicture}
\end{document}
Now, if I already have good looking shape near singularities (increased number of samples to 71):
on top of these points, there is a plane which I would like to remove and make it looks hollow (like on the picture bellow)
Since I didn't find any answer to this, I was thinking about using if in this manner:
IF (function value != value of mentioned plane)
addplot(function)
Hint: I tried IF THEN from tikz math library, but I ended in errors. But this can work I guess.
Q: Is possible to make similar code in LaTeX?
Is there more simple way to remove top plane?
Edit According to cfr suggestions, I did some corrections and MWE is provided.


