[Tex/LaTex] Making mesh grid lines transparent in surface plot with pgfplots

3dpgfplots

I need to make a partly transparent, one color, surface plot. Additionally I want to control the transparency of mesh lines. Running this code:

\documentclass{standalone}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\addplot3[surf, color=blue, opacity=0.5, domain=-2:2, faceted color=blue] {exp(-x^2-y^2)};
\end{axis}
\end{tikzpicture}
\end{document}

Produces the desired result only for the faces. Does pgfplots provide an option to control the transparency of mesh lines too?

Transparent surface with mesh lines visible

Best Answer

The opacity parameter controls transparency of mesh lines and surfaces. To make mesh lines much more transparent you can add fill opacity and decrease opacity:

\documentclass{standalone}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\addplot3[surf, color=blue, opacity=0.01,fill opacity=0.5, domain=-2:2, faceted color=blue] {exp(-x^2-y^2)};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here