# Pgfplots: embedding a line in a surface

I want to draw an identity across a surface plot. This identity should start at the bottom left, and end at the top right (from tip to tip). With the axis I've given (see below), the v_1=2(v_2-20). This becomes y=2(x-20) given the way the axes are defined. I've tried plotting this in various ways, but it does not seem to work on top of the 3d surface.

\begin{figure}[h]
\begin{tikzpicture}[scale=2]
\begin{axis}[
title={secret research},
xlabel=$v_2$, ylabel=$v_1$,
small,
x dir=reverse
]
surf,
domain=0:20,
domain y=0:10,
]
{((y^2/(0.5*(x+y))/20)};
\end{axis}
\end{tikzpicture} • I am sorry, I do not understand the question. Could you please make more explicit what you mean? What does "This becomes y=2(x-20) given the way the axes are defined. " mean? Do you just want to plot (x,{2*(x-20)})? But this is a 3d plot. – user121799 Sep 15 '18 at 14:31
• @marmot Sorry for it being unclear. I would like to plot the identity that maps across the surface diagonally from v_2=20 to v_1=10. This would be a single function, not a surface, as it is defined at one particular intersection of the v_2 and v_1 axes. – pafnuti Sep 15 '18 at 14:41
• You want a one-dimensional plot, i.e a line, then? At which z-value should this line be? Should it really be v_1=2(v_2-20), i.e. at v_1=0 v_2 will be -40, ie. far off from the surface? – user121799 Sep 15 '18 at 14:51
• @marmot Yes one-dimensional, at the z-value of the surface. – pafnuti Sep 15 '18 at 14:56

I hope I guess correctly.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[scale=2,declare function={f(\x,\y)=((\y*\y/(0.5*(\x+\y))/20);}]
\begin{axis}[
title={secret research},
xlabel=$v_2$, ylabel=$v_1$,
small,
x dir=reverse
]
surf,
domain=0:20,
domain y=0:10,
]
{(f(x,y)};
\end{axis}
\end{tikzpicture}
\end{document} Of course, you can choose whatever color you like for those lines.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[scale=2,declare function={f(\x,\y)=((\y*\y/(0.5*(\x+\y))/20);}]
\begin{axis}[
title={secret research},
xlabel=$v_2$, ylabel=$v_1$,
small,
x dir=reverse
]
surf,
domain=0:20,
domain y=0:10,
]
{(f(x,y)}; 