DominikPeters / tikz.dev-issues

Feedback, suggestions, and bug reports for tikz.dev
1 stars 0 forks source link

pgfplots: Wrong colormap in second example of `contour/levels from colormap` #30

Closed muzimuzhi closed 4 months ago

muzimuzhi commented 4 months ago

Describe the bug

Similar to #29 but this time the colormap is set manually hence maybe the culprit is different.

/pgfplots/contour/levels from colormap

Screenshots

MWE

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.18}

\begin{document}
\pgfplotscolorbardrawstandalone[
    colormap={whiteblue}{color=(blue) color=(white)},
    colormap={gb}{color=(green)
        color=(yellow) color=(brown)},
    colorbar style={minor x tick num=1},
    point meta min=-7052,               % <--
    point meta max=2895,                % <--
    of colormap/target pos min*=-7052,  % <--
    of colormap/target pos max*=2895,   % <--
    of colormap/sample for=const,       % <--
    colormap access=const,              % <--
    colormap={CM}{
        of colormap={
            whiteblue,
            target pos max=,
            target pos={-12000,-10000,-6000,-5000,
              -3000,-1000,-750,-500,-250,-100,-50,0}
        },
        of colormap={
            gb,
            target pos min=,
            target pos={10,100,200,500,1000,1100,
                1200,1500,2000,4000,6000,8000}
        },
    },
]
\end{document}
muzimuzhi commented 4 months ago

Since the example similar and next to it looks the same in PDF and HTML, I am guessing there's a chance this could be fixed.

Actually there are more broken examples (output shown in HTML and PDF looks quite different) of /pgfplots/contour filled and /pgfplots/contour/levels from colormap, perhaps due to viewer limitations.

Beware: Viewer Limitations

The following paragraph makes uses of pdf features which are unsupported by some free viewers (including pdf.js and evince). Please resort to a suitable viewer if you see unexpected results.