How to plot the solutions of an equation of a 3D Plot

3dequationshighlightingplottikz-pgf

I want to plot all possible solutions for sqrt(|x||y|) = 2 into my plot as a line. My code for the plot currently looks like this

\documentclass{article}

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

\begin{document}
    \begin{tikzpicture}
        
        \begin{axis}[ view={20}{45}]
            
            \addplot3 [
            domain=0:10,
            domain y = 0:10,
            samples = 30,
            %samples y = 80,
            mesh] {sqrt(abs(x) * abs(y))};
            
        \end{axis}
        
    \end{tikzpicture}
    
\end{document}

For the 3D plot, which looks like this

Plot result

How do I highlight all coordinates, which fulfill the equation? Moreover, is it possible to remove the little offset in z direction so that the graph is staying directly on the ground?

Best Answer

\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={10}{45}, zmin=0]
\addplot3 [
domain=0:10,
domain y=0:10,
samples=30,
mesh] {sqrt(abs(x) * abs(y))};
\addplot3[thick, domain=0:10, samples y=1, smooth] (x, {4/x}, 2);
\end{axis}
\end{tikzpicture}
\end{document}

Surface and path plot

Related Question