# Plot alignment using groupplot in pgfplots

I am using the groupplots library in pgfplots to create plot groupings. I am using the 2x2 sizing but only have 3 plots. How can I center the furthest right plot vertically, to make a triangle rather than an upside down L? In another case, I would like to center the bottom plot horizontally, would this use the same procedure? Is there a better tool to use than groupplots?

\documentclass{standalone}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{groupplots}

\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={group size=2 by 2},
width=4cm, height=4cm,
]
\nextgroupplot
\nextgroupplot
\nextgroupplot
\end{groupplot}
\end{tikzpicture}
\end{document}

-
Groupplots really shines when your subplots use the same axes, because it allows you to only show the axes on the edges of the groups. For more general alignments like the one you're looking for, using separate axis or even tikzpicture environments might be a better way to go. –  Jake Jul 11 '13 at 17:49
–  Adam Liter Jul 11 '13 at 17:51

Thanks to Jake's suggestion, a significant compression of my original solution is possible (since I don't know a thing about tikz). Also, a new version of stackengine should hit the streets this weekend. The syntax I used here will work in both old and new versions. You can control the inter-plot separation, if desired (i.e., normal hspacing will work between the top two plots, and an optional length argument to \stackunder will define the vertical gap).

\documentclass{standalone}
\usepackage{stackengine}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{groupplots}
\begin{document}
\stackunder{%
\begin{tikzpicture}
(0,0) (1,2) (2,1)}; \end{axis}
\end{tikzpicture}
\begin{tikzpicture}