# Rotate one row in matrix of nodes (tikz)

I am trying to rotate one row of a matrix of nodes. Is it possible?

MWE (rotation does not work):

\documentclass{standalone}
\usepackage{tikz}

\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes,nodes={circle,draw},
row 1/.style={align=left,rotate=90}]
{
t & &  \\
y & & v \\
h & g & \\
};
\end{tikzpicture}
\end{document}


You have to use transform shape to rotate the contents of a node. Further, you may wish to add anchor=center.

\documentclass{standalone}
\usepackage{tikz}

\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes,nodes={circle,draw,text depth=0.5ex,text height=1.5ex},
row 1/.style={nodes={align=left,rotate=90,anchor=center,transform shape}}]
{
t & &  \\
y & & v \\
h & g & \\
};
\end{tikzpicture}
\end{document}


Further, it is better to use text width so that all nodes align. Finally as mentioned by percusse apply the rotate operation only on nodes by

row 1/.style={nodes={align=left,rotate=90,anchor=center,transform shape}}

• Use row 1/.style={nodes={align=left,rotate=90}} syntax instead otherwise bad things will happen. Feb 2 '15 at 13:57