2

For certain colormaps, the mesh grid line color is too dark. I would like to make it less dark. However not a fixed color as set with faceted color=blue,.

My approach was to adjust the opacity as in this MWE

\documentclass{standalone}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
    \begin{tikzpicture}
    \begin{axis}[view={0}{90}]
    \addplot3[surf, domain=-2:2, samples=30,colormap/cool] {exp(-x^2-y^2)};
    \end{axis}
    \end{tikzpicture}   

    \begin{tikzpicture}
    \begin{axis}[view={0}{90}]
    \addplot3[surf, domain=-2:2, samples=30,colormap/cool,
        opacity=0.2,
        fill opacity=1,
    ] {exp(-x^2-y^2)};
    \end{axis}
    \end{tikzpicture}
\end{document}

It looks OK in TexStudio, but not if I open the pdf in chrome where the lines are now whiteisch:

enter image description here

Anyway I think opacity is the wrong approach. I suppose it is necessary to adjust shader=flat,draw=\pgfkeysvalueof{/pgfplots/faceted color} (page 139 in the manual) but I don't know how.

2
  • Looks like a viewer issue. Have you tried other PDF viewers?
    – Alenanno
    May 28, 2016 at 9:58
  • Yes, but as I said I think opacity is the wrong way to do this. May 28, 2016 at 10:23

1 Answer 1

2

I think I found the solution in pgfplots.code.tex

\documentclass{standalone}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
    \begin{tikzpicture}
    \begin{axis}[view={0}{90}]
    \addplot3[surf, domain=-2:2, samples=30,colormap/cool,
        shader=flat,
        draw=mapped color!90!black, % original: mapped color!80!black
    ] {exp(-x^2-y^2)};
    \end{axis}
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .