Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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

share|improve this answer

the same with pst-solides3d. Run it with xelatex:

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}

\psset{viewpoint=50 20 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\begin{pspicture}(-3.5,-2)(3.5,3)
\psSurface[opacity=0.7,strokeopacity=0.4,fillcolor=blue!80,linecolor=blue!40,
           linewidth=0.2pt,algebraic,ngrid=0.1 0.1,axesboxed,
           Zmin=0,Zmax=2,showAxes=false](-2,-2)(2,2){2*e^(-x^2-y^2)}
\end{pspicture}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.