33

Share your most complex TikZ drawing and learning out of it.

  • 18
    Not sure how suitable this question is for this site. It is quite broad and does not have a definitive answer (cf. tex.stackexchange.com/help/dont-ask). texample.net has a collection of complex (and maybe also not so complex) TikZ drawings. – moewe Mar 13 at 9:32
  • 5
    It is true that this site is very lenient with (some) big-list questions, but I feel that the current formulation "your most complicated" is just too subjective. – moewe Mar 13 at 9:53
  • 2
    None of my TikZ drawings are complex since I was able to make them. Some TikZ drawings seem very complex to realize for me, but as they were made by others, I can not share them. – Paul Gaborit Mar 13 at 23:28
  • 2
    This question is off-topic because every answer is equally valid: “What’s your favorite ______?” – EJoshuaS Mar 14 at 22:52
  • 3
    @siracusa No, definitely not. See also: Real Questions have Answers. This falls under the category of "chatty, open-ended questions" and "mindless social fun," not a "practical, answerable question based on actual problems that you face." – EJoshuaS Mar 15 at 3:09

10 Answers 10

41

Inspired by Raaja's answer. This is the standard rotating snakes.

\documentclass[tikz,border=9]{standalone}

\begin{document}
\tikz{
    \draw(-10,-10)rectangle+(20,20);
    \foreach\x/\y in{
        -1/ 1,  0/ 1,  1/ 1,
        -1/ 0,  0/ 0,  1/ 0,
        -1/-1,  0/-1,  1/-1,
          -.5/ .5, .5/ .5,
          -.5/-.5, .5/-.5
    }{
        \begin{scope}
            \tikzset{shift={(\x*6.6,\y*6.6)},xscale=(-1)^(\x+\y)}
            \pgflowlevelsynccm
            \foreach\j in{1,...,15}{
                \draw[line width=6mm,
                    dash pattern={on13.408ptoff13.408pt},
                    dash phase=\j*13.408pt]
                    circle(3);
                \draw[line width=6mm,white,
                    dash pattern={on13.408ptoff13.408pt},
                    dash phase=(\j+1)*13.408pt]
                    circle(3);
                \foreach\i in{1,...,20}{
                    \tikzset{rotate=\i*18+\j*9}
                    \fill[yellow!80!black]
                        (3,0)ellipse[x radius=3mm,y radius=1.5mm];
                    \tikzset{rotate=9}
                    \fill[blue]
                        (3,0)ellipse[x radius=3mm,y radius=1.5mm];
                }
                \tikzset{scale=.81818}
                \pgflowlevelsynccm
            }
        \end{scope}
    }
}
\end{document}

  • Tex capacity exceeded for me. – BPP Apr 2 at 6:29
  • @BPP Try to reduce \foreach\j in{1,...,15}. This loop is filling the center of the circle, which is not really necessary. – Symbol 1 Apr 2 at 16:17
25

I have to repost this one (details here):

enter image description here

Most PDF viewers can't render it and the code is a mess, but it's certainly complicated (856 lines of complicated).

24

This is not the most complicated drawing I have ever coded1 but certainly the proudest picture I have ever had. That is the TikZified2 version of the most well-known picture ever – the Mona Lisa!

enter image description here

The code (2.43 MB) is too long to be pasted here. You can see it here.


1 | In fact, you can see well that this picture is not made by me. It is generated via Inkscape. However, this is certainly the most complicated picture ever compiled in my computer and not made by anyone else (i.e. I got it without any human help with the help (or the idea) of Leonardo da Vinci only).

2 | I stole this word from @marmot. I hope he will give me the permission to use the word once he reads my answer.

  • How long did you took to achieve this? Very nice (+1). – Raaja Mar 13 at 11:43
  • @Raaja Well, it was made with Inkscape, so it is not so difficult. (If I drew the picture manually it would take centuries :D). But it takes a while to vectorize the original image, convert it to TikZ and then compile the code. My editor became not responding for a couple of minutes :)) – JouleV Mar 13 at 11:46
  • Huhh like that ;). I assumed you created this by mixing colors yourself :D. But still quite an amount of work though. – Raaja Mar 13 at 11:48
  • @Raaja I mentioned about it in footnote 1. Let's imagine if someone drew this manually: finding the coordinates of the control points takes about half of a century, some other decades for coding and debugging. Only a lifetime is taken for this work :DD – JouleV Mar 13 at 11:50
  • 2
    “not made by anyone else (i.e. I got it without any human help)” — a certain Leonardo might claim a little share of the credit… (+1, lovely example) – Peter LeFanu Lumsdaine Mar 14 at 20:27
23

About a thousand lines of code, grabbing data from a bunch of external files and plotting stuff. The code is a mess but adaptable enough to display different data sets. Also came across some really strange bugs while working on it (such as: loading in large tables of data into TikZ may overlook a particular column until the document is compiled a second time or the column afterwards is also loaded.)

enter image description here

  • 8
    where is the code? – dozer Mar 15 at 5:09
20

This was complicated when I did it. Now it's more large than difficult or complicated. The original illustration is from "The Illustrated Network: How TCP/IP Works in a Modern Network" by Walter Goralski.

enter image description here

\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{tikz}

\usetikzlibrary{matrix,shapes.symbols,fit,positioning}
\begin{document}

\def\monitor{--+(6mm,0mm)--+(5mm,2mm)--+(3mm,2mm)--+(2mm,4mm)--+(5mm,4mm)--+(5mm,11mm)--+
(-5mm,11mm)--+(-5mm,4mm)--+(-2mm,4mm)--+(-3mm,2mm)--+(-5mm,2mm)--+(-6mm,0mm)--cycle}
\def\display{++(3mm,5mm) --++(0,5mm)--++(-6mm,0mm)--++(0mm,-5mm)--cycle}
\def\casa{--++(5mm,0mm)--++(0,7mm)--++(2mm,0mm)--++(-7mm,4mm)
--++(-7mm,-4mm)--++(2mm,0mm)--++(0mm,-7mm)--cycle}

\begin{tikzpicture}[font=\sffamily,
host/.style={draw, text width=3.5cm, fill=orange!10,font=\sffamily\small, align=left},
falshost/.style={rectangle, minimum width=2cm, minimum height=8mm},
router/.style={draw, text width=3cm, minimum height=1cm, fill=blue!20, align=center},
etiqueta/.style={font=\sffamily\small, align=center}]


\begin{scope}
\matrix[ampersand replacement=\&,column sep=2mm,row sep=2mm] {
    \node[host] (bsdclient) {
        em0: 10.10.11.177\\MAC: 00:0e:0c:3b:8f:94\\(Intel\_3b:8f:94)\\IPv6: fe80::20e:cff:fe3b:8f94}; \&
    \node[host] (lnxserver) {
        eth0: 10.10.11.66\\MAC: 00:db:b7:1f:fe:e6\\(Intel\_1f:fe:e6)\\IPv6: fe80::2d0:b7ff:fe1f:fee6}; \&
    \node[host] (wincli1) {
        LAN2: 10.10.11.51\\MAC: 00:0e:0c:3b:88:3c\\(Intel\_3b:88:3c)\\IPv6: fe80::20e:cff:fe3b:883c}; \&
    \node[host] (winsvr1) {
        LAN2: 10.10.11.111\\MAC: 00:0e:0c:3b:87:36\\(Intel\_3b:87:36)\\IPv6: fe80::20e:cff:fe3b:8736};\\[4mm]
    \node[falshost] (sbsdclient) {}; \& 
    \node[falshost] (slnxserver) {}; \& 
    \node[falshost] (swincli1) {}; \& 
    \node[falshost] (swinsvr1) {}; \\
};

    \node[fill=gray!30, inner sep=0pt, rectangle, rounded corners=4mm,fit=(sbsdclient)  (swinsvr1)] (lan1) {Ethernet LAN Switch with Twisted Pair-Wiring};
    \node[below,anchor=north east] at (lan1.south east) {\textbf{LAN1}};
    \draw (bsdclient) -- (sbsdclient);
    \draw (lnxserver) -- (slnxserver);
    \draw (wincli1) -- (swincli1);
    \draw (winsvr1) -- (swinsvr1);

    \foreach \a in {bsdclient, lnxserver, wincli1, winsvr1}
    {
        \fill[gray!30] ([yshift=1mm]\a.north) \monitor;
        \fill[white] ([yshift=1mm]\a.north) \display;
        \path (\a.north) ++(0mm,12mm) node[above] {\textbf{\a}};
    }

    \node[router,anchor=north] (CE0) [below = of lan1] {CE0\\\textbf{lo0: 192.168.0.1}};
    \draw (lan1)--(CE0);
    \path (CE0.east)++(2mm,0mm) node[anchor=west,align=left,font=\sffamily\small] (tCE0)  {fe-1/3/0: 10.10.11.1\\
MAC= 00:05:85:88:cc:db\\(Juniper\_88:cc:db)\\IPv6: fe80:205:85ff:fe88:ccdb};
    \node[text width=2cm,align=center] () at (bsdclient|-CE0) {Los Angeles\\Office};
\end{scope}

\begin{scope}[xshift=16cm]
\matrix[ampersand replacement=\&,column sep=2mm,row sep=2mm] {
    \node[host] (bsdserver) {
        eth0: 10.10.12.77\\MAC: 00:0e:0c:3b:87:32\\(Intel\_3b:87:32)\\IPv6: fe80::20e:cff:fe3b:8732}; \&
    \node[host] (lnxclient) {
        eth0: 10.10.12.166\\MAC: 00:b0:d0:45:34:64\\(Dell\_45:34:64)\\IPv6: fe80::2b0:d0ff:fe45:3464}; \&
    \node[host] (winsvr2) {
        LAN2: 10.10.12.52\\MAC: 00:0e:0c:3b:88:56\\(Intel\_3b:88:56)\\IPv6: fe80::20e:cff:fe3b:8856}; \&
    \node[host] (wincli2) {
        LAN2: 10.10.11.222\\MAC: 00:02:b3:27:fa:8c\\\mbox{\null} \\IPv6: fe80::202:b3ff:fe27:fa8c};\\[4mm]
    \node[falshost] (sbsdserver) {}; \& 
    \node[falshost] (slnxclient) {}; \& 
    \node[falshost] (swinsvr2) {}; \& 
    \node[falshost] (swincli2) {}; \\
};

    \node[fill=gray!30, inner sep=0pt, rectangle, rounded corners=4mm,fit=(sbsdserver)  (swincli2)] (lan2) {Ethernet LAN Switch with Twisted Pair-Wiring};
    \node[below,anchor=north east] at (lan2.south east) {\textbf{LAN2}};
    \draw (bsdserver) -- (sbsdserver);
    \draw (lnxclient) -- (slnxclient);
    \draw (winsvr2) -- (swinsvr2);
    \draw (wincli2) -- (swincli2);

    \foreach \a in {bsdserver, lnxclient, winsvr2, wincli2}
    {
        \fill[gray!30] ([yshift=1mm]\a.north) \monitor;
        \fill[white] ([yshift=1mm]\a.north) \display;
        \path (\a.north) ++(0mm,12mm) node[above] {\textbf{\a}};
    }

    \node[router,anchor=north] (CE6) [below = of lan2] {CE6\\\textbf{lo0: 192.168.6.1}};
    \draw (lan2)--(CE6);
    \path (CE6.east)++(2mm,0mm) node[anchor=west,align=left,font=\sffamily\small] (tCE6)  {fe-1/3/0: 10.10.12.1\\
MAC= 00:05:85:8b:bc:db\\(Juniper\_8b:bc:db)\\IPv6: fe80:205:85ff:fe8b:bcdb};
    \node[text width=2cm,align=center] () at (bsdserver|-CE6) {New York\\Office};
\end{scope}

\begin{scope}[shift={(8cm,-9cm)}]
\matrix [ampersand replacement=\&,column sep=2.5cm,row sep=1.5cm]  {
    \& \node[router] (P9) {P9\\\textbf{lo0: 192.168.9.1}}; \& \& \node[router] (P7) {P7\\\textbf{lo0: 192.168.7.1}}; \& \\
    \node[router] (PE5) {PE5\\\textbf{lo0: 192.168.5.1}}; \& \& \& \&  \node[router] (PE1) {PE1\\\textbf{lo0: 192.168.1.1}}; \\
    \& \node[router] (P4) {P4\\\textbf{lo0: 192.168.4.1}}; \& \& \node[router] (P2) {P2\\\textbf{lo0: 192.168.2.1}}; \& \\
};
\draw (P9.east) -- (P7.west) 
    node[etiqueta,very near start] {so-0/0/1\\79.2}  
    node[etiqueta,very near end] {so-0/0/1\\79.1};
\draw (P9.south) -- (P4.north) 
    node[etiqueta,very near start,align=right,left] {so-0/0/3\\49.2}  
    node[etiqueta,very near end,align=right,left] {so-0/0/3\\49.1};
\draw (P4.east) -- (P2.west) 
    node[etiqueta,very near start] {so-0/0/1\\24.2}  
    node[etiqueta,very near end] {so-0/0/1\\24.1};
\draw (P7.south) -- (P2.north) 
    node[etiqueta,very near start,align=left,right] {so-0/0/3\\27.2}  
    node[etiqueta,very near end,align=left,right] {so-0/0/3\\27.1};
\draw (P9.south east) -- (P2.north west) 
    node[etiqueta,very near start,sloped] {so-0/0/2\\29.2}  
    node[etiqueta,very near end,sloped] {so-0/0/2\\29.1};
\draw (P4.north east) -- (P7.south west) 
    node[etiqueta,very near start,sloped] {so-0/0/0\\47.1}  
    node[etiqueta,very near end,sloped] {so-0/0/0\\47.2};
\draw (PE5.east) -- (P9.west) 
    node[etiqueta,near start,sloped] {so-0/0/0\\59.1}  
    node[etiqueta,near end,sloped] {so-0/0/0\\59.2};
\draw (PE5.east) -- (P4.west) 
    node[etiqueta,near start,sloped] {so-0/0/2\\45.2}  
    node[etiqueta,near end,sloped] {so-0/0/2\\45.1};
\draw (P7.east) -- (PE1.west) 
    node[etiqueta,near start,sloped] {so-0/0/2\\17.2}  
    node[etiqueta,near end,sloped] {so-0/0/2\\17.1};
\draw (P2.east) -- (PE1.west) 
    node[etiqueta,near start,sloped] {so-0/0/0\\12.2}  
    node[etiqueta,near end,sloped] {so-0/0/0\\12.1};
\draw[dashed,very thick,gray] (PE5.north) -- (CE0.south) 
    node[etiqueta,pos=.15,sloped,black] {ge-0/0/3\\50.1}  
    node[etiqueta,pos=.85,sloped,black] (ge502) {ge-0/0/3\\50.2};
\draw[dashed,very thick,gray] (CE6.south) -- (PE1.north) 
    node[etiqueta,pos=.15,sloped,black] (ge162) {ge-0/0/3\\16.2}  
    node[etiqueta,pos=.85,sloped,black] {ge-0/0/3\\16.1};
\end{scope}

    \fill[green!50] (bsdclient|-P9) \casa;
    \node[xshift=1cm,align=center,anchor=south west] at (bsdclient|-P9) {\textbf{Wireless}\\\textbf{in home}};
    \draw[dotted] (bsdclient|-P9) -- (PE5.north) node[above,sloped,pos=0.5] {DSL Link};
    \draw[dashed] (bsdclient.west|-ge502.west)--(winsvr1.east|-ge502.west);
    \draw[dashed] (bsdserver.west|-ge162.east)--(wincli2.east|-ge162.east);

    \node[cloud,draw,aspect=2,cloud puffs=15,text width=3cm, align=center,anchor=north,fill=violet!20] (internet) at (PE1|-P2.south)  {\textbf{Global Public}\\\textbf{Internet}};
    \draw (P4) |- ([yshift=-3mm]internet) node [pos=0.6,above] {AS 65459};
    \draw (P2) |- ([yshift=3mm]internet) node [pos=0.7,above] {AS 65127};

    \node[text width=5cm, align=left, font=\sffamily\small,anchor=south west] at (bsdclient.west|-internet.south) {Solid rules = SONET/SDH\\Dashed rules = Gigabit Ethernet\\\emph{Note}:All links use 10.0.x.y\\addressing. Only the last\\two octets are shown.};
\end{tikzpicture}

\end{document} 

Some other Tikz figures are already here:

  • 1
    I would like to bring to your notice that the above url "Soccer/Football teams" points to a post containing Karnaugh maps. – GermanShepherd Mar 13 at 10:31
  • @GermanShepherd Corrected! Thank you for pointing it. – Ignasi Mar 13 at 10:40
15

I was once a note-taker for disabled students, and for the final lecture I ended the last set of notes with a TikZ version of the Looney Tunes ending screen. First time using \foreach, and the decorations library.

\documentclass{article}

\usepackage{tikz}
\usepackage[margin=0pt]{geometry}
\usepackage{fontspec}

\usetikzlibrary{decorations.text, shadows}
\newfontfamily\looney[]{That's Font Folks!}
\definecolor{darkblueOuter}{RGB}{1,11,23}
\definecolor{darkblueInner}{RGB}{1,18,37}

\begin{document}
\looney
\fontsize{68pt}{1em}\selectfont

\thispagestyle{empty}

% Manual centering
\vspace*{-4.25cm}
\hspace{-8cm}

\begin{tikzpicture}[scale=1.3, every shadow/.style={opacity=1,fill=blue!10!black}]
  \foreach \l in {13.8,12.8,...,2.8} {
    \path[circular glow={shadow scale=1.03}, shading=radial, inner color=yellow!80!white, outer color=red!50!black] (0, 0) circle (\l cm);
  }

  \path[circular glow={shadow scale=1.03}, shading=radial, inner color=blue!25!black, outer color=darkblueOuter] (0, 0) circle (2.8cm);

  \node (b) at (-6, -2) {};
  \node (e) at (7, -0.5) {};
  \draw[decoration={text along path, text color=white, text={That's all Folks!}}, decorate] (b) to[bend left=15] (e);
\end{tikzpicture}
\end{document}

Looney Tunes

  • 3
    For the sake of “meta” of this community wiki, I hope this answer stays at the end. ;-) – Kess Vargavind Mar 16 at 4:44
11

I learned how to use loops in TikZ for the first-time ever.

\documentclass{standalone}
\usepackage{tikz}
%https://tex.stackexchange.com/questions/471465/drawing-concentric-circles-with-alternating-colors-by-means-of-foreach-in-tikz/471466#471466
\begin{document}
\begin{tikzpicture}[mystyle/.style={circle,draw,fill=none,minimum size=20, line width = 8pt}]
  \foreach \x in {1,3,5,7,9,11,13,15,17,19}
\node [mystyle,  minimum size = \x cm, color =red!70]  (2) at (0, 0) {};
  \foreach \x in {2,4,6,8,10,12,14,16,18, 20}
\node [mystyle,  minimum size = \x cm, color =yellow!50]  (2) at (0, 0) {};
\end{tikzpicture}
\end{document}

to get:

enter image description here

  • 8
    This image is kind of hypnotising :) – user36296 Mar 13 at 10:34
  • @samcarter I know right? Therefore, I am proud of this image as my first looped creation :D – Raaja Mar 13 at 10:54
  • 1
    @samcarter, not like this one – Sigur Mar 14 at 1:27
  • 2
    @Sigur I would answer your comment, but I cannot stop staring at those wheels :) – user36296 Mar 14 at 8:58
  • 1
    @samcarter specially when we try to focus on a circle center... – Sigur Mar 14 at 11:04
4

Just for fun purposes.

\documentclass[tikz]{standalone}
\begin{document}
\foreach \y in {0,10,...,110}{
\begin{tikzpicture}
    \shade[top color=orange,bottom color=yellow] (-2.2,-2.2) rectangle (2.2,2.2);
    \shade[ball color=black] (0,0) circle (.25);
    \foreach \x in {\y,\y+120,\y+240}{\shadedraw[left color=black,right color=gray] (\x:2) arc (\x:\x+60:2) -- (\x+60:.3) arc (\x+60:\x:.3) -- cycle;}
\end{tikzpicture}}
\end{document}

enter image description here

  • The code gave me a sequence of images. – BPP Apr 2 at 6:17
  • 2
    @BPP: I am surprised you said that. – Artificial Hairless Armpit Apr 2 at 9:04
3

I am in the process of making an overview of symmetric functions.

For a quick overview how these relate to each other, I made the following two tikz images:

Relations graph Positivity graph

Here is a small part of the relations graph. Arrows indicate relations such as "is superset of", "specialize to", "is related via other transformation", etc. small part of graph of relationships between symmetric functions

3

Not too complicated but it was the last one I draw.

enter image description here

\documentclass[border=0mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}\footnotesize
\begin{tikzpicture}
\def\raio{.75}
\def\N{10}
\coordinate (Z\N) at (1.5*\N,0);
\node[thick, circle, minimum size=2*\raio cm, draw] (C\N) at (Z\N){};
\foreach \x in {1,...,\N}{
    \coordinate (Z\x) at (1.5*\x,0);
    \fill (Z\x) circle (1pt);
    \node[circle, minimum size=1.5*\raio cm] (C\x) at (Z\x){};
    \ifnum \x=1
        \draw[thick] (C1.north) to[out=30,in=150] (C1.east) to[out=-30,in=-10] (C1.south) to[out=170,in=-10] (C1.west) to[out=170,in=210] (C1.north)node[above]{$V_n(x)$};
        \node[below] at (Z\x){$x$};
        \draw[-latex] (C10) to[out=-60,in=-60]node[below]{$f^{-n}$} (C\x.south);
        \draw[-latex] (C1.east)  to[out=35,in=140]node[below]{$f^n$} (C\N);
    \fi
    \ifnum \x=2
        \node[below] at (Z\x){$f(x)$};
        \draw[-latex] (C10) to[out=-65,in=-60]node[above]{$f^{-(n-1)}$} (C\x.south);
    \fi
    \ifnum \x=5
        \node[below] at (Z\x){$f^j(x)$};
        \draw[-latex] (C10) to[out=-70,in=-60]node[above]{$f^{-j}$} (C\x.south);
    \fi
    \ifnum \x=8
        \node[below] at (Z\x){$f^{n-2}(x)$};
        \draw[-latex] (C10) to[out=-75,in=-60]node[below]{$f^{-2}$} (C\x.south);
    \fi
    \ifnum \x=9
        \node[below] at (Z\x){$f^{n-1}(x)$};
        \draw[-latex] (C10) to[out=-85,in=-60]node[above]{$f^{-1}$} (C\x.south);
    \fi
    \ifnum \x=\N
        \node[below] at (Z\x){$f^{n}(x)$};
    \fi
}

\draw (Z10) --node[above]{$\delta$} ($(Z\N)+(45:\raio cm)$);
\node (contraction) at ($(Z\N)+(-35:3*\raio cm)$){\normalsize contraction};

\end{tikzpicture}
\end{document}

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.