2

When I use rotate on a node, it seems to be rotated against its west(As in figure (up) and (middle)), however, what I meant is to rotate it against its center, like (bottom) of figure shows. I didn't find such a parameter in manual....

enter image description here


\begin{tikzpicture}
[sampleA/.style={text width=1cm, text height=2cm},
sampleB/.style={text width=1.5cm, text height=.5cm},
every node/.style={draw, rectangle, align=center}]
%% up 
\node (A) at (0,0) [sampleA] {A};
\node[sampleB] (B)  [right=.1cm of A] {B};
%% middle
\node (A) at (0,-3) [sampleA] {A};
\node (B) [sampleB, right=.1cm of A, rotate=-90] {B};
%% bottom
\node (A) at (0,-7) [sampleA] {A};
\node (B) [sampleB, right=.1cm of A, rotate=-90, xshift=-.8cm, yshift=.5cm] {B};
\end{tikzpicture}

UPDATE

I tried to use round around, but it fails:

\node (A) at (0,-7) [sampleA] {A};
\node (B3) [sampleB, right=.1cm of A, rotate around={-90:(B3.center)}, xshift=-.8cm, yshift=.5cm] {B};

Error says:

Package pgf Error No shape named B3 is known.

  • A node rotate around its anchor. In your code, the right option of node B3 implies the west anchor. Add the anchor=south option... – Paul Gaborit Nov 14 '13 at 16:48

Browse other questions tagged or ask your own question.