TikZ

Everything started with me wanting one of my diagrams to be more beautiful. I googled a lot and eventually found that TikZ would solve my one specific problem. So I installed the package and put the manual on my desktop (I need access as fast as possible). Soon I got the diagram I wanted and was amazed on how nice it looked. It really does matter if the font and style fit with the remaining document!

So I decided that I should change all my diagrams to TikZ-diagrams (at least the ones not made with R, which already look very nice). It cost me quite some time and work, but once I saw the result I knew it was worth it. But… there was still one diagram I was hesitating to change. It took me quite some time to make it with dia and I was afraid of the time it would cost to redo it with TikZ, but eventually I surrendered to my urge to have not ‘all-but-one’, but rather ‘all’ diagrams in a nice style. Some hours later I was done and below you can see the result (click the image to see it bigger)…

And here’s the Latex-code I used… I know, it’s much less than perfect - TikZ offers a lot of more advanced features to deal with all the repetitions, but for now that’s it, plain and simple (and long):


\begin{figure}[!h]  
\begin{center}
\fbox{\begin{tikzpicture}[font=\scriptsize]

\node at (2.85,2)[text centered] (in) {Heard and seen speech};
\draw[thin,-triangle 90] (1.2,1.5)->(1.2,0.5);
\draw[thin,-triangle 90] (4.5,1.5)->(4.5,0.5);

\draw (0,0.5) rectangle (5.7,-7);

\draw[thick] (0.3,0) -- (0.3,-0.2);
\draw[thick] (0.6,0) -- (0.6,-0.2);
\draw[thick] (0.9,0) -- (0.9,-0.2);
\draw[thick] (1.2,0) -- (1.2,-0.2);
\draw[thick] (1.5,0) -- (1.5,-0.2);
\draw[thick] (1.8,0) -- (1.8,-0.2);
\draw[thick] (2.1,0) -- (2.1,-0.2);
\draw[thick] (2.4,0) -- (2.4,-0.2);
\draw[thick] (2.7,0) -- (2.7,-0.2);
\draw[thick] (3,0) -- (3,-0.2);
\draw[thick] (3.3,0) -- (3.3,-0.2);
\draw[thick] (3.6,0) -- (3.6,-0.2);
\draw[thick] (3.9,0) -- (3.9,-0.2);
\draw[thick] (4.2,0) -- (4.2,-0.2);
\draw[thick] (4.5,0) -- (4.5,-0.2);
\draw[thick] (4.8,0) -- (4.8,-0.2);
\draw[thick] (5.1,0) -- (5.1,-0.2);
\draw[thick] (5.4,0) -- (5.4,-0.2);

\draw[very thick] (0.3,-3) -- (0.3,-3.3);
\draw[very thick] (0.9375,-3) -- (0.9375,-3.3);
\draw[very thick] (1.575,-3) -- (1.575,-3.3);
\draw[very thick] (2.2125,-3) -- (2.2125,-3.3);
\draw[very thick] (2.85,-3) -- (2.85,-3.3);
\draw[very thick] (3.4875,-3) -- (3.4875,-3.3);
\draw[very thick] (4.125,-3) -- (4.125,-3.3);
\draw[very thick] (4.7625,-3) -- (4.7625,-3.3);
\draw[very thick] (5.4,-3) -- (5.4,-3.3);

\draw[ultra thick] (0.3,-6) -- (0.3,-6.5);
\draw[ultra thick] (1.32,-6) -- (1.32,-6.5);
\draw[ultra thick] (2.34,-6) -- (2.34,-6.5);
\draw[ultra thick] (3.36,-6) -- (3.36,-6.5);
\draw[ultra thick] (4.38,-6) -- (4.38,-6.5);
\draw[ultra thick] (5.4,-6) -- (5.4,-6.5);

\draw[thin] (0.3,-2.8)-- (0.3,-0.4);
\draw[thin] (0.3,-2.8)-- (1.2,-0.4);
\draw[thin] (0.3,-2.8)-- (3.6,-0.4);
\draw[thin] (0.3,-2.8)-- (5.4,-0.4);
\draw[thin] (0.9375,-2.8)-- (0.3,-0.4);
\draw[thin] (0.9375,-2.8)-- (2.1,-0.4);
\draw[thin] (0.9375,-2.8)-- (3.3,-0.4);
\draw[thin] (0.9375,-2.8)-- (4.5,-0.4);
\draw[thin] (1.575,-2.8)-- (0.6,-0.4);
\draw[thin] (1.575,-2.8)-- (1.8,-0.4);
\draw[thin] (1.575,-2.8)-- (2.4,-0.4);
\draw[thin] (1.575,-2.8)-- (3.9,-0.4);
\draw[thin] (2.2125,-2.8)-- (1.5,-0.4);
\draw[thin] (2.2125,-2.8)-- (2.7,-0.4);
\draw[thin] (2.2125,-2.8)-- (3,-0.4);
\draw[thin] (2.2125,-2.8)-- (2.4,-0.4);
\draw[thin] (2.85,-2.8)-- (4.2,-0.4);
\draw[thin] (2.85,-2.8)-- (5.1,-0.4);
\draw[thin] (2.85,-2.8)-- (0.3,-0.4);
\draw[thin] (2.85,-2.8)-- (1.2,-0.4);
\draw[thin] (2.85,-2.8)-- (4.8,-0.4);
\draw[thin] (3.4875,-2.8)-- (3,-0.4);
\draw[thin] (3.4875,-2.8)-- (3.3,-0.4);
\draw[thin] (3.4875,-2.8)-- (3.6,-0.4);
\draw[thin] (3.4875,-2.8)-- (1.8,-0.4);
\draw[thin] (4.125,-2.8)-- (0.9,-0.4);
\draw[thin] (4.125,-2.8)-- (2.7,-0.4);
\draw[thin] (4.125,-2.8)-- (4.5,-0.4);
\draw[thin] (4.125,-2.8)-- (5.1,-0.4);
\draw[thin] (4.7625,-2.8)-- (0.6,-0.4);
\draw[thin] (4.7625,-2.8)-- (3.9,-0.4);
\draw[thin] (4.7625,-2.8)-- (1.5,-0.4);
\draw[thin] (4.7625,-2.8)-- (4.8,-0.4);
\draw[thin] (4.7625,-2.8)-- (5.4,-0.4);
\draw[thin] (5.4,-2.8)-- (2.1,-0.4);
\draw[thin] (5.4,-2.8)-- (4.2,-0.4);
\draw[thin] (5.4,-2.8)-- (5.4,-0.4);
\draw[thin] (5.4,-2.8)-- (0.9,-0.4);

\draw[thin] (0.3,-3.5)--(0.3,-5.8);
\draw[thin] (0.9375,-3.5)--(0.3,-5.8);
\draw[thin] (3.4875,-3.5)--(0.3,-5.8);
\draw[thin] (4.7625,-3.5)--(0.3,-5.8);
\draw[thin] (0.3,-3.5)--(1.32,-5.8);
\draw[thin] (1.575,-3.5)--(1.32,-5.8);
\draw[thin] (2.85,-3.5)--(1.32,-5.8);
\draw[thin] (4.125,-3.5)--(1.32,-5.8);
\draw[thin] (2.2125,-3.5)--(2.34,-5.8);
\draw[thin] (3.4875,-3.5)--(2.34,-5.8);
\draw[thin] (0.9375,-3.5)--(2.34,-5.8);
\draw[thin] (4.125,-3.5)--(2.34,-5.8);
\draw[thin] (1.575,-3.5)--(3.36,-5.8);
\draw[thin] (2.2125,-3.5)--(3.36,-5.8);
\draw[thin] (5.4,-3.5)--(3.36,-5.8);
\draw[thin] (0.9375,-3.5)--(3.36,-5.8);
\draw[thin] (2.85,-3.5)--(4.38,-5.8);
\draw[thin] (0.3,-3.5)--(4.38,-5.8);
\draw[thin] (4.125,-3.5)--(4.38,-5.8);
\draw[thin] (5.4,-3.5)--(4.38,-5.8);
\draw[thin] (1.575,-3.5)--(5.4,-5.8);
\draw[thin] (2.85,-3.5)--(5.4,-5.8);
\draw[thin] (4.7625,-3.5)--(5.4,-5.8);
\draw[thin] (5.4,-3.5)--(5.4,-5.8);

\node(phone) at (-1,-0.1)[text width=1.5cm,text centered]  {Phonetic units};
\node(phono) at (-1.3,-3.15)[text width=1.5cm,text centered]  {Phonological units};
\node(phonem) at (-1,-6.25)[text width=1.5cm,text centered]  {Abstract phonemic units};
\node(speech) at (-2.5,-3.15)[rotate=90]  {Perceiving speech};
\node(proc) at (2.85,-9)[draw, minimum height=1.5cm]  {Lexical processor};
\node(sys) at (7,-3.15)[text width=2cm,text centered] {Input phonetic-phonological system};

\draw[thin,triangle 90-triangle 90] (proc) -- (2.85,-7);

\end{tikzpicture}}
\end{center}
\end{figure}
Written by Dörte de Kok, 14 Sep 2010 View Comments