# Special effects in TikZ leads to unprintable PDF [closed]

So I recently made a picture of the Mexican Hat Potential (related to the Brout-Englert-Higgs Mechanism of particle physics). I am more than satisfied with the graph and everything, but I noticed after a while that the below PDF of the Mexican Hat Potential is kind of corrupt. I suspect the shaded ball.

It is corrupt in the sense that when you try to print it: On some softwares it cannot be printed at all (like acroread of UNIX) and with some other softwares only one quarter (the third quadrant) of the ball is actually printed together with the rest of the document.

Is there anyone that knows why the shaded ball leads to complications?

For completeness, I hereby paste the code and the resulting graph. Notice that the code for the ball is from this post on TSE.

The Code:

    \documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
%% calculate unit coordinates
25 div exch
25 div exch
%% copy stack
2 copy
%% compute -z^2 of the current position
dup mul exch
1.0 sub
%% and the -z^2 of the light source
0.3 dup mul
1.0 sub
%% now their sqrt product
mul abs sqrt
%% and the sum product of the rest
%% max(dotprod,0)
%% matte-ify
%% currently there is just one number in the stack.
%% we need three corresponding to the RGB values
dup
0.4
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[  axis lines=center, axis on top = false,
view={140}{25},axis equal,title={The Mexican hat potential},
colormap={blackwhite}{gray(0cm)=(1); gray(1cm)=(0)},
samples=50,
domain=0:360,
y domain=0:1.25,
zmin=0,
xmax=1.5,
ymax=1.5,
zmax=1.5,
x label style={at={(axis description cs:0.10,0.25)},anchor=north},
y label style={at={(axis description cs:0.9,0.2)},anchor=north},
z label style={at={(axis description cs:0.5,0.9)},anchor=north},
xlabel = $\mathrm{Re}(\phi)$,
ylabel=$\mathrm{Im}(\phi)$,
zlabel=$V(\phi)$,
yticklabels={,,},
xticklabels={,,},
zticklabels={,,}
]
\end{axis}
\node[anchor=east] at (4.05,3.71) (text) {A};
\node[anchor=west] at (5.5,3.0) (description) {B};
\draw (description) edge[out=180,in=0,<-] (text);
\end{tikzpicture}
\end{document}


And here's the resulting graph

• This is because of the shading of the ball. See my comments under that solution where you picked it up. The stack has the wrong final settings tripping the PDF flattening. Mar 6, 2015 at 15:59
• Yeah I suspected that Mar 6, 2015 at 18:01
• @percusse Perhaps you could link to your comments? I tried the link in the question but I can't find any comment by you on that page.
– cfr
Mar 6, 2015 at 22:45
• @cfr OP should have linked it to Simon's post. tex.stackexchange.com/questions/54193/… as it is his answer in play here Mar 7, 2015 at 2:57
• I'm voting to close this question as off-topic because it was solved in the comments May 11, 2019 at 21:41