Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgfplotsthemetol puts \pgfplotsset{compat=1.9} at end of preamble, overriding other settings #397

Open
jasperhabicht opened this issue Dec 13, 2023 · 0 comments

Comments

@jasperhabicht
Copy link

The metropolis theme loads the pgfplotsthemetol package which essentially sets \AtEndPreamble{ \pgfplotsset{compat=1.9} } and thereby overrides other settings of the PGF key compat.

The problem is that compat=1.9 is relatively old and therefore some functions are not activated such as using axis coordinates inside the axis environment when using standard TikZ commands such as \draw or \fill without the need to prexis the coordinates with axis cs:.

A solution to this is to set \AtEndPreamble{ \pgfplotsset{compat=1.18} } instead of \pgfplotsset{compat=1.18} in the preamble, but it is not obvious to the user why they should do that.

Consider the following MWE:

\documentclass{beamer}
\usetheme{metropolis}

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

%\AtEndPreamble{
%    \pgfplotsset{compat=1.18}
%}

\begin{document}
    \begin{frame}
        \begin{tikzpicture}
            \begin{axis}
                \addplot coordinates {(0,0) (1,1)};
                \fill[red] (0.5,0.5) circle[radius=2pt];
            \end{axis}
        \end{tikzpicture}
    \end{frame}
\end{document}

Uncommenting %\AtEndPreamble{ \pgfplotsset{compat=1.18} } fixes the problem and the red circle is placed in the middle of the plot instead of somewhere at the origin.

A simple solution would be to just avoid setting compat via the pgfplotsthemetol package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant