4

The MWE puts plots in a 2x2 matrix:

x x

x -

I'd like to place the plots differently:

x -

x x

MWE:

\documentclass{standalone}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

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

\begin{document}
    \begin{tikzpicture} 
        \begin{groupplot}[group style={group size=2 by 2, horizontal sep=4em}]
            \nextgroupplot[xlabel=$x$, ylabel={$f(x) = x^2 - x +4$}]
                \addplot {x^2 - x +4};

            \nextgroupplot[xlabel=$x$, ylabel={$f(x) = x^2 - x +4$}]
                \addplot {x^2 - x +4};

            \nextgroupplot[xlabel=$x$, ylabel={$f(x) = x^2 - x +4$}]
                \addplot {x^2 - x +4};
        \end{groupplot}     
    \end{tikzpicture}
\end{document}

1 Answer 1

5

Add \nextgroupplot[group/empty plot] after the first groupplot.

enter image description here

\documentclass{standalone}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

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

\begin{document}
    \begin{tikzpicture} 
        \begin{groupplot}[group style={group size=2 by 2, horizontal sep=4em}]
            \nextgroupplot[xlabel=$x$, ylabel={$f(x) = x^2 - x +4$}]
                \addplot {x^2 - x +4};

            \nextgroupplot[group/empty plot]

            \nextgroupplot[xlabel=$x$, ylabel={$f(x) = x^2 - x +4$}]
                \addplot {x^2 - x +4};

            \nextgroupplot[xlabel=$x$, ylabel={$f(x) = x^2 - x +4$}]
                \addplot {x^2 - x +4};
        \end{groupplot}     
    \end{tikzpicture}
\end{document}
1
  • 1
    May also required axis background/.style={fill=none} if the user defined a common background.
    – anderstood
    Oct 21, 2016 at 16:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .