Questions tagged [groupplots]

The groupplots library of pgfplots, which is made to facilitate placing multiple axes in a grid, with common settings.

The groupplots library of the pgfplots package defines a new environment groupplot for use within a tikzpicture environment. The number of rows and columns are defined by group style={group size=<columns> by <rows>}. To initiate a subplot, use \nextgroupplot, which also allows one to set individual options for each axis, e.g. \nextgroupplot[title=...].

A simple example:

\documentclass[border=5mm]{standalone}

\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\begin{document}
\begin{tikzpicture}

\begin{groupplot}[
  group style={
    group size=2 by 3,
    x descriptions at=edge bottom, % tick/axis labels only on bottom
    y descriptions at=edge left, % tick/axis labels only on left
    horizontal sep=5pt, % horizontal distance between axes
    vertical sep=5pt, % vertical distance between axes
    },
  % the following settings will apply to all the subplots
  width=4cm,
  height=3cm,
  ylabel=Lorem,
  xlabel=Ipsum,
  domain=0:10,
  ymin=-0.05,ymax=1.05
]

% first row, first column
\nextgroupplot
\addplot {rnd};

% first row, second column
\nextgroupplot
\addplot {rnd};

% second row, first column
\nextgroupplot
\addplot {rnd};

% etx
\nextgroupplot
\addplot {rnd};

\nextgroupplot
\addplot {rnd};

\nextgroupplot
\addplot {rnd};

\end{groupplot}
\end{tikzpicture}
\end{document}

enter image description here

202 questions
2
votes
0 answers

nested groupplots

What is the best way to make a groupplot of a few groupplots? I'll need to be able to add tick-labels to both "levels" (the inner and outer groupplots, think Inception 2010). For example, each red/blue square is a plot. Each 5x5 pane is a…
12.yakir
  • 419
1
vote
0 answers

Reduce horizontal space between columns

I'm using groupplot to generate the following graph: Regarding right graph: If the space between the columns was reduced, then the graph would be more beautiful. Right now the columns are overlapping the graph's border, and there is plenty of space…
Vingtoft
  • 183
1
vote
1 answer

Nested axis in groupplot (2 plots in groupplot)?

Is it possible to have a smaller plot embedded into one of the plots of a groupplot? Similar to a magnified region of the plot at the top corner, which is part of a group of other plots in the groupplot environment.I know its possible to do it in a…