2

I want to create a 2x2 + 1 plot like...

---------------------------|
| Plot 1 | Plot 2 |        |
------------------- Plot 5 | 
| Plot 3 | Plot 4 |        |
---------------------------|

How can I achieve that? With the pgfplots package?

2
  • 1
    Can you post a dummy example for the plots? It's really not fun to write up 5 sub plots from scratch. – percusse Jun 4 '13 at 21:17
  • 1
    Yeah for some reason I was only thinking in groupplots but subfigure is a much better solution since they indeed don't have the same caption. – WG- Jun 4 '13 at 21:23
3

Here's something to get you started

screenshot

I have used the subcaption package which provides, among other things, the subfigure environment. You can think of this as a minipage- it takes all of the same mandatory and optional arguments.

Adjust the widths as you like :)

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage{pgfplots}
\usepackage{subcaption}

\pgfplotsset{
    every axis/.append style={
        scale only axis,       
        width=\textwidth,
    }
}

\begin{document}

\begin{figure}%
    \begin{minipage}{.5\textwidth}
    \centering
        \begin{subfigure}{.4\textwidth}
            \begin{tikzpicture}
                \begin{axis}
                    \addplot {x^2};
                \end{axis}
            \end{tikzpicture}
            \caption{}
        \end{subfigure}%
        \hfill
        \begin{subfigure}{.4\textwidth}
            \centering
            \begin{tikzpicture}
                \begin{axis}
                    \addplot {x^2};
                \end{axis}
            \end{tikzpicture}
            \caption{}
        \end{subfigure}%
        \\
        \begin{subfigure}{.4\textwidth}
            \begin{tikzpicture}
                \begin{axis}
                    \addplot {x^2};
                \end{axis}
            \end{tikzpicture}
            \caption{}
        \end{subfigure}%
        \hfill
        \begin{subfigure}{.4\textwidth}
            \begin{tikzpicture}
                \begin{axis}
                    \addplot {x^2};
                \end{axis}
            \end{tikzpicture}
            \caption{}
        \end{subfigure}
    \end{minipage}%
    \begin{minipage}{.5\textwidth}
    \centering
        \begin{subfigure}{.9\textwidth}
            \begin{tikzpicture}
                \begin{axis}
                    \addplot {x^2};
                \end{axis}
            \end{tikzpicture}
            \caption{}
        \end{subfigure}
    \end{minipage}%
    \caption{}%
    \label{}%
\end{figure}


\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.