I have a single line matrix made with TikZ:

\node [matrix,fill=white!20,draw=blue] (my matrix) at (3,2)
\node(a) {40}; & \node{AE}; & \node{B0}; & \node(b) {05}; & \node(b) {05};\\

Is there a way to "twist" this matrix along a curve (I would like to illustrate something like a flow ...) and to "open it" at both ends?

  • Please provide a minimal example and state your dependencies. Your replace ampersand with doesn't work work for me. Are you using a recent CVS version? – user10274 Feb 26 '12 at 10:04
  • OK. I removed the "replace ampersand". I am using texlive 2010. The code I show compile without problem. My question is about the possibility to "twist" this matrix. (thanks percusse) – jean Feb 26 '12 at 10:11
  • I have completed your code, however effectively you can do the same with :\matrix [fill=white!20,draw=blue,matrix of nodes] (my matrix) {40 & AE & B0& 05 & 05 \\};. You don't need to enter \node in each cell. Moreover, I don't think matrix is the way to go but you can do that with text decorations. See manual Section 30.6 – percusse Feb 26 '12 at 10:17
  • thanks percusse; il will have a look to text decorations ! – jean Feb 26 '12 at 10:32
  • How to do you want to specify the curve? – Peter Grill Feb 26 '12 at 17:13

¡Viva la Answering the unanswered movement !

I have written a simple code demonstrating the detail in my comment. The details are given in the manual section 30.6 (version 2.10)

\draw[style=help lines,opacity=0.3] (-2,-1) grid[step=1cm] (4,5);
\matrix [fill=white!20,draw=blue,matrix of nodes] (my matrix) {40 & AE & B0 & 05 & 05 \\};
                    text along path,
                    text align={center,left indent=2.5cm},
                    text={40 AE B0 05 05},
                double distance=5mm,
                blue] (2,0) -- (2,4) -- (0.5,1.5) -- ++(10:3cm);

Notice that the text might get weird while trying hard to follow the curve so use responsibly. I think I overdid this when I was testing out different options but anyway here is an image with some further examples:

enter image description here

  • Nice.. Any reason you don't just post the code corresponding to the image? – Peter Grill Mar 23 '12 at 2:05
  • @PeterGrill It's just longish for such a simple detail. Basically I draw two more paths with ..controls (p1) and (p2)... – percusse Mar 23 '12 at 2:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.