# pgfplots: strange opacity in surf plot

I do have the following code to get a surf plot which gives me for some reason the 'backside' of the plot with full opacity. How can I change this behavior? Actually, I think this feature is very nice, but I'd like to control it, if possible.

So question nr 1 would be: How to get rid of this and get the 'normal' behavior?

nr 2: How can I control (change the opacity etc) the behavior of the 'backside'?

\documentclass{standalone}
\usepackage{pgfplots,tikz}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
width=\linewidth,
height=0.9\linewidth,
view={-142}{40},
%scale only axis,
xmin=0,
xmax=0.5,
xtick={0,0.1,0.2,0.3,0.4,0.5},
xmajorgrids,
ymin=0,
ymax=30,
ytick={0,10,20,30},
ymajorgrids,
zmin=0,
zmax=1,
ztick={0,0.2,0.4,0.6,0.8,1},
zmajorgrids
]
surf,
%opacity=0.3,fill opacity=0.8,
draw=black,
colormap/jet,
mesh/rows=51
]
\end{axis}
\end{tikzpicture}%
\end{document}


Since the data file is quite large, I uploaded it here: http://pastebin.com/qXmpY6W5

Edit: Here is a MATLAB figure of the same data but from a different angle to show how it actually looks like.

• Try setting z buffer=sort. – Jake Jun 24 '14 at 8:18
• @Jake an answer? – cmhughes Jun 24 '14 at 14:08

In cases like this, it often helps to set z buffer = sort.