Trying to gain a little vertical padding with a matrix of nodes and having trouble. In a regular matrix I could just add [2em] etc after the row or column delimiter to add a little padding between rows or columns. That's not seeming to work in a matrix of nodes. Suggestions??

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, calc, positioning,matrix}

\tikzset{
state/.style={rounded rectangle, draw, text centered, minimum height=3em ,minimum width = 6em, inner sep = 5pt},
test/.style = {diamond, draw, shape aspect=2, inner sep = 0pt,text width = 7em,text centered},
action/.style ={rectangle, draw,text width=8em,inner sep = 3pt, minimum height=5em},
data/.style = {trapezium, draw, trapezium left angle=60, trapezium right angle=120pt, minimum height = 6em},
line/.style = {draw, -triangle 45},
list/.style = {rectangle, draw,minimum width = 6em},
ptr-box/.style = {rectangle, text width = 8em}
}

\begin{document}
\begin{tikzpicture}[
align = flush center,
font = \small]
\matrix [
matrix of nodes,
column sep = 0.5em,
row sep = 1.3em,
draw, dashed,
nodes = {solid},
] (mtrx)
{
|[state]| \\
|[data]|  b\\
|[test]|  c\\
|[action]|d\\
|[test]|  e\\
|[action]|f\\
|[action]|g\\[2em] %Not working
};
\end{tikzpicture}

\end{document}


EDIT: I should have been more specific. I'm looking to add space only at the bottom and possibly to one side of the matrix of nodes

-

I'd suggest to add another row, but transform the node to an coordinate (which has no height) so you get an additional row sep and the usual (as before) inner ysep (of the matrix). If you want to have 2em in sum you'd add [.7em] to your last \\:

## Code

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, calc, positioning,matrix}
\tikzset{
state/.style={rounded rectangle, draw, text centered, minimum height=3em ,minimum width = 6em, inner sep = 5pt},
test/.style = {diamond, draw, shape aspect=2, inner sep = 0pt,text width = 7em,text centered},
action/.style ={rectangle, draw,text width=8em,inner sep = 3pt, minimum height=5em},
data/.style = {trapezium, draw, trapezium left angle=60, trapezium right angle=120pt, minimum height = 6em},
line/.style = {draw, -triangle 45},
list/.style = {rectangle, draw,minimum width = 6em},
ptr-box/.style = {rectangle, text width = 8em}
}
\begin{document}
\begin{tikzpicture}[
align = flush center,
font = \small]
\matrix [
matrix of nodes,
column sep = 0.5em,
row sep = 1.3em,
draw, dashed,
nodes = {solid},
] (mtrx)
{
|[state]| \\
|[data]|  b\\
|[test]|  c\\
|[action]|d\\
|[test]|  e\\
|[action]|f\\
|[action]|g\\[.7em]
|[coordinate]|\\
};
\end{tikzpicture}
\end{document}


## Output

That is the last row of the matrix, the linebreak [2em] will have no effect.

But you can use one of the inner *sep keys (pp. 175/176 of the PGF/TikZ manual).
There are three kinds of inner separators:

• inner sep defines the inner space in both directions.
• inner xsep … in x-direction (initially .3333em)
• inner ysep … in y-direction (initially .3333em)

For example:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, calc, positioning,matrix}

\tikzset{…}

\begin{document}
\begin{tikzpicture}[
align = flush center,
font = \small]
\matrix […
inner sep = 2em
] (mtrx) {
|[state]| \\
|[data]|  b\\
|[test]|  c\\
|[action]|d\\
|[test]|  e\\
|[action]|f\\
|[action]|g\\
};
\end{tikzpicture}
\end{document}


-
I'm sorry, I should have been more specific. I'm looking to add space only at the bottom and possibly to one side of the matrix of nodes The inner *sep is very close, but still adds to both ends. – blitzvergnugen Sep 12 '12 at 21:19
@blitzvergnugen If you add one more \ after your last row you get an extra empty row (and the 2em get into account). You can then adjust it to your needs (but the empty row has its own height). – Qrrbrbirlbel Sep 12 '12 at 21:24
@blitzvergnugen I've updated my answer. Does this achieve what you wanted (looks odd to me, though)? – Qrrbrbirlbel Sep 12 '12 at 21:39
That works. I have a path that comes out of g.south and snakes up, so that's why I wanted the space at just the bottom. Seems like a deficiency of matrix of nodes to not have the same fine grained control of spacing like a regular matrix though. – blitzvergnugen Sep 13 '12 at 15:12
@blitzvergnugen Why not use \path (g.south) ++(0,-2em) … or the like? – Qrrbrbirlbel Sep 13 '12 at 15:21