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

groupplots trim axis group left not compatible with group name #479

Open
microlith57 opened this issue May 31, 2024 · 0 comments
Open

groupplots trim axis group left not compatible with group name #479

microlith57 opened this issue May 31, 2024 · 0 comments

Comments

@microlith57
Copy link

Currently, using /pgfplots/trim axis group left fails if the group name is redefined with /pgfplots/group/group name, which causes problems eg. when using remember picture in a document with multiple group plots (as in this case it is useful to rename the group).

Specifically, this line:

\pgfkeysalso{/tikz/trim left={(group c1r1.south west)}}%

hardcodes the group name as group, which is not always the case.

This can be worked around by setting /tikz/trim left={(custom name c1r1.south west)} instead, which has the desired effect.

Example:

\documentclass[a4paper]{article}

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

\begin{document}
\centering

\begin{tikzpicture}[trim axis group left,trim axis group right]
  \begin{groupplot}[
    group style={group size=2 by 2, group name=custom name},
    height=3cm,width=3cm
  ]
  \nextgroupplot
    \addplot coordinates {(0,0) (1,1) (2,2)};
  \nextgroupplot
    \addplot coordinates {(0,2) (1,1) (2,0)};
  \nextgroupplot
    \addplot coordinates {(0,2) (1,1) (2,1)};
  \nextgroupplot
    \addplot coordinates {(0,2) (1,1) (1,0)};
  \end{groupplot}
\end{tikzpicture}

\end{document}

yields

Package pgf Error: No shape named `group c1r1' is known.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant