# Projecting contour on the floor in a 3d plot

The contour is drawn on the top surface, I'm trying to plot the contour on the floor (A-B).

\documentclass{standalone}

\usepackage{pgfplots}
\pgfplotsset{width=10cm, compat=1.9}

\begin{document}

\begin{tikzpicture} \begin{axis}
[
xlabel=$A$,
ylabel=$B$,
zlabel=$f_0$,
grid=major,
]

surf,
opacity=0.4,
] {4*x + 5*y};

contour gnuplot, samples=21]
{4*x + 5*y};

\end{axis} \end{tikzpicture}

\end{document}

• \addplot3 [ contour gnuplot, samples=21,z filter/.code={\def\pgfmathresult{-49.9}}] {4*x + 5*y}; ? (Or any value you want instead of -49.9.) – user121799 Mar 5 at 19:08
• I tried that, this changes the contour height, but it's not on the floor perfectly. – Taha Magdy Mar 5 at 19:10

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=10cm, compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$A$,
ylabel=$B$,
zlabel=$f_0$,
grid=major,zmax=55,zmin=-55
]

surf,
opacity=0.4,
] {4*x + 5*y};


• @TahaMagdy I just set zmin to -55 and added the contour a tiny bit above (such that it does not clipped away). – user121799 Mar 5 at 19:25