pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
196 stars 34 forks source link

[layers] Incompatibility between set layers and enlargelimits since v1.8 #130

Open pgf-tikz-bot opened 8 years ago

pgf-tikz-bot commented 8 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/130/ Author: mnies Timestamp: 2016-09-02 08:36:41.910000

https://sourceforge.net/p/pgfplots/bugs/130/attachment/Test_Surf.pdf When trying to use the layers feature combined with the enlargelimits option, surface plots are shifted away from their original position and aligned to the top right corner of the axis. This only happens, when compat is set to 1.8 or newer, with 1.7 everything works fine, as you can see with the exaple below.

\documentclass{scrartcl}

\usepackage{pgfplots}
\pgfplotsset{set layers, width=.8\columnwidth}

\usepackage{filecontents}
\begin{filecontents}{data.dat}
        x   y
        1   1
        1   2
        1   3
        1   4
        1   5

        2   1
        2   2
        2   3
        2   4
        2   5

        3   1
        3   2
        3   3
        3   4
        3   5

        4   1
        4   2
        4   3
        4   4
        4   5
\end{filecontents}

\begin{document}
    \begin{figure}
        \pgfplotsset{compat=newest}
        \begin{tikzpicture}
            \begin{axis}[grid]
                \addplot[surf, shader=interp, point meta={x*y}, on layer=axis background] table{data.dat};
            \end{axis}
        \end{tikzpicture}
        \caption{Compat=newest}
    \end{figure}

    \begin{figure}
        \pgfplotsset{compat=1.7}
        \begin{tikzpicture}
            \begin{axis}[grid]
                \addplot[surf, shader=interp, point meta={x*y}, on layer=axis background] table{data.dat};
            \end{axis}
        \end{tikzpicture}
        \caption{compat=1.7}
    \end{figure}
\end{document}
pgf-tikz-bot commented 8 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/130/#8bdc Author: cfeuersaenger Timestamp: 2016-09-04 13:11:29.937000

Thanks for the detailed report... It appears to be related with shader=interp.

I can reproduce it and I will look into it.

pgf-tikz-bot commented 8 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/130/#cb70 Author: cfeuersaenger Timestamp: 2016-09-04 13:18:28.309000

I can narrow down the problem to "clip path=upper bound"; a feature that was introduced with 1.8 and which becomes active as soon as one writes "compat=1.8".

If you write

\pgfplotsset{compat=1.8, compat/BB/1.7}

in the first example, the displacement is gone.