Paul Thompson | 6 May 05:59 2008
Picon
Picon

matrix nodes with sloped option?


I was wondering why matrix nodes do not respond to the sloped option or 
rotations?

\begin{tikzpicture}
\draw (0,0) -- 
node[sloped,above,near start]{A}        %Normal node which slopes OK
node[sloped,above,matrix of nodes,ampersand replacement=\&]
{ 
      A \& B \\
      C \& D \\
}   %matrix node which doesnt slope
(5,5);

\path(4,2) node[draw,transform shape,rotate=45,matrix of nodes,ampersand 
replacement=\&]{ 
      A \& B \\
      C \& D \\
}; %matrix node which doesn't rotate

\path(6,2) node[draw,transform shape,rotate=45]
{ 
      A
};  %node which rotates OK

\end{tikzpicture} 

Thanks for the great package,  pgf and tikz !
Thanks for your help.
regards,
(Continue reading)

Mark Wibrow | 6 May 08:44 2008

Re: matrix nodes with sloped option?

Hi,

It does say in the manual that it isn't possible (in section 16.2
"Matrices are Nodes"), and that the transformation matrix is reset at
the beginning of a matrix. The (internal) use of \halign precludes any
kind of fancy transformations. It would be pretty hard to do matrices
without using \halign.

Regards

Mark

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Till Tantau | 6 May 12:10 2008
Picon

Re: matrix nodes with sloped option?

Indeed.

However, you can do the following: Put the whole node inside a  
tikzpicture, which in turn you put in a node that has the sloped  
option. Something like

... (A) -- (B) node[midway,sloped] {\tikz \matrix ...;};

That is not quite as "nice" as the standard way, but, as the manual  
says, halign simply makes "direct sloping" impossible.

Hoping this helps,
Till

Am 06.05.2008 um 08:44 schrieb Mark Wibrow:
> Hi,
>
> It does say in the manual that it isn't possible (in section 16.2
> "Matrices are Nodes"), and that the transformation matrix is reset at
> the beginning of a matrix. The (internal) use of \halign precludes any
> kind of fancy transformations. It would be pretty hard to do matrices
> without using \halign.
>
> Regards
>
> Mark
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save  
(Continue reading)


Gmane