image
imagewidth (px)
384
384
text
stringlengths
2.58k
12.8k
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usepackage{relsize} \usepackage{bm} \usetikzlibrary{positioning,decorations.pathmorphing} \definecolor{mygreen}{rgb}{0,0.6,0} \definecolor{mymauve}{rgb}{0.58,0,0.82} \definecolor{camdrk}{RGB}{0,62,114} \begin{document} \begin{tikzpicture} \node[circle, draw, thick] (h1) {}; \node[circle, draw, thick, right=of h1] (h2) {}; \node[circle, draw, thick, below=of h1] (h3) {}; \node[circle, draw, thick, right=of h3] (h4) {}; \node[circle, draw, thick, below=of h3] (h5) {}; \node[circle, draw, thick, right=of h5] (h6) {}; \draw[-, thick] (h1) -- (h4); \draw[-, thick] (h2) -- (h3); \draw[-, thick] (h2) -- (h4); \draw[-, thick] (h3) -- (h4); \draw[-, thick] (h3) -- (h6); \draw[-, thick] (h4) -- (h5); \draw[-, thick] (h5) -- (h6); \path [draw=black, smooth, fill=camdrk, fill opacity=0.3, very thick] ([xshift=-0.5em,yshift=0.5em]h1.north west) -- ([xshift=0.5em,yshift=0.5em]h2.north east) -- ([xshift=0.5em,yshift=-0.5em]h6.south east) -- ([xshift=-0.5em,yshift=-0.5em]h5.south west) -- cycle; \node[circle, draw, thick, red, fill=red!10, right=10em of h1] (g1) {}; \node[circle, draw, thick, red, fill=red!10, right=of g1] (g2) {}; \node[circle, draw, thick, below=of g1] (g3) {}; \node[circle, draw, thick, right=of g3] (g4) {}; \node[circle, draw, thick, red, fill=red!10, below=of g3] (g5) {}; \node[circle, draw, thick, right=of g5] (g6) {}; \draw[-, thick, dashed, lightgray] (g1) -- (g4); \draw[-, thick, dashed, lightgray] (g2) -- (g3); \draw[-, thick, dashed, lightgray] (g2) -- (g4); \draw[-, thick] (g3) -- (g4); \draw[-, thick] (g3) -- (g6); \draw[-, thick, dashed, lightgray] (g4) -- (g5); \draw[-, thick, dashed, lightgray] (g5) -- (g6); \node[red] (icr) at (g1) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[red] (icr) at (g2) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[red] (icr) at (g5) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \path [draw=black, smooth, fill=mymauve, fill opacity=0.3, very thick] ([xshift=-0.5em,yshift=0.5em]g3.north west) -- ([xshift=0.5em,yshift=0.5em]g4.north east) -- ([xshift=0.5em,yshift=-0.5em]g6.south east) -- ([xshift=-0.5em,yshift=-0.5em]g6.south west) -- ([xshift=-0.5em,yshift=-0.5em]g3.south west) -- cycle; \node[circle, thick, right=10em of g1] (i1) {}; \node[circle, thick, right=of i1] (i2) {}; \node[circle, draw, thick, below=of i1] (i3) {}; \node[circle, draw, red, thick, fill=red!10, right=of i3] (i4) {}; \node[circle, thick, below=of i3] (i5) {}; \node[circle, draw, thick, right=of i5] (i6) {}; \draw[-, thick, dashed, lightgray] (i3) -- (i4); \draw[-, thick] (i3) -- (i6); \node[red] (icr) at (i4) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \draw[-stealth, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=0.5em]h4.east) -- node[below, black] {pool} node[above] {GCN} ([xshift=-0.5em]g3.west); \draw[-stealth, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=0.5em]g4.east) -- node[above] {GCN} node[below] {pool}([xshift=-0.5em]i3.west); \path [draw=black, smooth, fill=mygreen, fill opacity=0.3, very thick] ([xshift=-0.5em,yshift=0.5em]i3.north west) -- ([xshift=0.5em,yshift=0.5em]i3.north east) --([xshift=0.5em,yshift=0.5em]i6.north east) --([xshift=0.5em,yshift=-0.5em]i6.south east) -- ([xshift=-0.5em,yshift=-0.5em]i6.south west) -- ([xshift=-0.5em,yshift=-0.5em]i3.south west) -- cycle; \node[circle, draw, thick, right=10em of i3] (S) {$\boldsymbol\Sigma$}; \path[-stealth, mymauve, ultra thick] ([xshift=0.5em, yshift=0.5em]g4.north east) edge[bend left,decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] node[sloped,above] {mean $\|$ max} (S); \path[-stealth, mygreen, ultra thick] ([xshift=0.4em]i6.east) edge[bend right,decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] node[sloped,below] {mean $\|$ max} (S); \node[right=5em of S] (P) {\emph{predict}}; \draw[-stealth, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (S.east) --node[above] {MLP} (P.west); \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usepackage{bm} \usepackage{relsize} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \node[circle, draw, thick] (i1) {}; \node[circle, draw, thick, above=2em of i1] (i2) {}; \node[circle, draw, thick, above=2em of i2] (i3) {}; \node[circle, draw, thick, below=2em of i1] (i4) {}; \node[circle, draw, thick, below=2em of i4] (i5) {}; \node[circle, draw, thick, right=4em of i1] (h1) {}; \node[circle, draw, thick, right=4em of i2] (h2) {}; \node[circle, draw, thick, right=4em of i3] (h3) {}; \node[circle, draw, thick, right=4em of i4] (h4) {}; \node[circle, draw, thick, right=4em of i5] (h5) {}; \node[circle, draw, thick, right=4em of h1] (hh1) {}; \node[circle, draw, thick, right=4em of h2] (hh2) {}; \node[circle, draw, thick, right=4em of h3] (hh3) {}; \node[circle, draw, thick, right=4em of h4] (hh4) {}; \node[circle, draw, thick, right=4em of h5] (hh5) {}; \node[circle, draw, thick, right=4em of hh2] (o1) {}; \node[circle, draw, thick, right=4em of hh4] (o2) {}; \draw[-stealth, thick] (i1) -- (h1); \draw[-stealth, thick] (i1) -- (h2); \draw[-stealth, thick] (i1) -- (h3); \draw[-stealth, thick] (i1) -- (h4); \draw[-stealth, thick] (i1) -- (h5); \draw[-stealth, thick] (i2) -- (h1); \draw[-stealth, thick] (i2) -- (h2); \draw[-stealth, thick] (i2) -- (h3); \draw[-stealth, thick] (i2) -- (h4); \draw[-stealth, thick] (i2) -- (h5); \draw[-stealth, thick] (i3) -- (h1); \draw[-stealth, thick] (i3) -- (h2); \draw[-stealth, thick] (i3) -- (h3); \draw[-stealth, thick] (i3) -- (h4); \draw[-stealth, thick] (i3) -- (h5); \draw[-stealth, thick] (i4) -- (h1); \draw[-stealth, thick] (i4) -- (h2); \draw[-stealth, thick] (i4) -- (h3); \draw[-stealth, thick] (i4) -- (h4); \draw[-stealth, thick] (i4) -- (h5); \draw[-stealth, thick] (i5) -- (h1); \draw[-stealth, thick] (i5) -- (h2); \draw[-stealth, thick] (i5) -- (h3); \draw[-stealth, thick] (i5) -- (h4); \draw[-stealth, thick] (i5) -- (h5); \draw[-stealth, thick] (h1) -- (hh1); \draw[-stealth, thick] (h1) -- (hh2); \draw[-stealth, thick] (h1) -- (hh3); \draw[-stealth, thick] (h1) -- (hh4); \draw[-stealth, thick] (h1) -- (hh5); \draw[-stealth, thick] (h2) -- (hh1); \draw[-stealth, thick] (h2) -- (hh2); \draw[-stealth, thick] (h2) -- (hh3); \draw[-stealth, thick] (h2) -- (hh4); \draw[-stealth, thick] (h2) -- (hh5); \draw[-stealth, thick] (h3) -- (hh1); \draw[-stealth, thick] (h3) -- (hh2); \draw[-stealth, thick] (h3) -- (hh3); \draw[-stealth, thick] (h3) -- (hh4); \draw[-stealth, thick] (h3) -- (hh5); \draw[-stealth, thick] (h4) -- (hh1); \draw[-stealth, thick] (h4) -- (hh2); \draw[-stealth, thick] (h4) -- (hh3); \draw[-stealth, thick] (h4) -- (hh4); \draw[-stealth, thick] (h4) -- (hh5); \draw[-stealth, thick] (h5) -- (hh1); \draw[-stealth, thick] (h5) -- (hh2); \draw[-stealth, thick] (h5) -- (hh3); \draw[-stealth, thick] (h5) -- (hh4); \draw[-stealth, thick] (h5) -- (hh5); \draw[-stealth, thick] (hh1) -- (o1); \draw[-stealth, thick] (hh1) -- (o2); \draw[-stealth, thick] (hh2) -- (o1); \draw[-stealth, thick] (hh2) -- (o2); \draw[-stealth, thick] (hh3) -- (o1); \draw[-stealth, thick] (hh3) -- (o2); \draw[-stealth, thick] (hh4) -- (o1); \draw[-stealth, thick] (hh4) -- (o2); \draw[-stealth, thick] (hh5) -- (o1); \draw[-stealth, thick] (hh5) -- (o2); \draw[-stealth, double, dashed, thick] (5.5,0) -- node[above] {dropout} (8.6, 0); %%% BOUNDARY %%% \node[circle, draw, thick, red, fill=red!10, right=15em of hh1] (i1) {}; \node[circle, draw, thick, red, fill=red!10, above=2em of i1] (i2) {}; \node[circle, draw, thick, above=2em of i2] (i3) {}; \node[circle, draw, thick, below=2em of i1] (i4) {}; \node[circle, draw, thick, below=2em of i4] (i5) {}; \node[red] (icr) at (i1) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[red] (icr) at (i2) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[circle, draw, thick, red, fill=red!10, right=4em of i1] (h1) {}; \node[circle, draw, thick, right=4em of i2] (h2) {}; \node[circle, draw, thick, red, fill=red!10, right=4em of i3] (h3) {}; \node[circle, draw, thick, red, fill=red!10, right=4em of i4] (h4) {}; \node[circle, draw, thick, right=4em of i5] (h5) {}; \node[red] (icr) at (h1) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[red] (icr) at (h3) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[red] (icr) at (h4) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[circle, draw, thick, right=4em of h1] (hh1) {}; \node[circle, draw, thick, red, fill=red!10, right=4em of h2] (hh2) {}; \node[circle, draw, thick, right=4em of h3] (hh3) {}; \node[circle, draw, thick, red, fill=red!10, right=4em of h4] (hh4) {}; \node[circle, draw, thick, right=4em of h5] (hh5) {}; \node[red] (icr) at (hh2) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[red] (icr) at (hh4) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; \node[circle, draw, thick, right=4em of hh2] (o1) {}; \node[circle, draw, thick, right=4em of hh4] (o2) {}; \draw[-stealth, thick] (i3) -- (h2); \draw[-stealth, thick] (i3) -- (h5); \draw[-stealth, thick] (i4) -- (h2); \draw[-stealth, thick] (i4) -- (h5); \draw[-stealth, thick] (i5) -- (h2); \draw[-stealth, thick] (i5) -- (h5); \draw[-stealth, thick] (h2) -- (hh1); \draw[-stealth, thick] (h2) -- (hh3); \draw[-stealth, thick] (h2) -- (hh5); \draw[-stealth, thick] (h5) -- (hh1); \draw[-stealth, thick] (h5) -- (hh3); \draw[-stealth, thick] (h5) -- (hh5); \draw[-stealth, thick] (hh1) -- (o1); \draw[-stealth, thick] (hh1) -- (o2); \draw[-stealth, thick] (hh3) -- (o1); \draw[-stealth, thick] (hh3) -- (o2); \draw[-stealth, thick] (hh5) -- (o1); \draw[-stealth, thick] (hh5) -- (o2); \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % 1st column \node at (0,6.5) {$t-1$}; \node[align=center, circle, draw, thick] (s1_1) at (0,5) {$s_1$\\{\scriptsize$\alpha_{t-1}(s_1)$}}; \node[align=center, circle, draw, thick] (s2_1) at (0,3) {$s_2$\\{\scriptsize$\alpha_{t-1}(s_2)$}}; \node[align=center, circle, draw, thick] (s3_1) at (0,1) {$s_3$\\{\scriptsize$\alpha_{t-1}(s_3)$}}; \node[align=center, circle, draw, thick] (s4_1) at (0,-1) {$s_4$\\{\scriptsize$\alpha_{t-1}(s_4)$}}; \node [draw, thick] at (0,-2.5) {$(y_{t-1}, id_{t-1})$}; % 2nd column \node at (3.5,6.5) {$t$}; \node[circle, draw, thick] (s1_2) at (3.5,5) {$s_1$} edge[gray, thin, stealth-] (s1_1) edge[gray, thin, stealth-] (s2_1) edge[gray, thin, stealth-] (s3_1) edge[gray, thin, stealth-] (s4_1); \node[circle, draw, thick] (s3_2) at (3.5,1) {$s_3$} edge[gray, thin, stealth-] (s1_1) edge[gray, thin, stealth-] (s2_1) edge[gray, thin, stealth-] (s3_1) edge[gray, thin, stealth-] (s4_1); \node[circle, draw, thick] (s4_2) at (3.5,-1) {$s_4$} edge[gray, thin, stealth-] (s1_1) edge[gray, thin, stealth-] (s2_1) edge[gray, thin, stealth-] (s3_1) edge[gray, thin, stealth-] (s4_1); \node[align=center, circle, draw, ultra thick, minimum size=4.25em] (s2_2) at (3.5,3) {$s_2$\\{\scriptsize$\alpha_{t}(s_2)$}}; % 3rd column \node [] (asdf2) at (8.5,-2.5) {$(y_{t+1}, id_{t+1})$}; \node [draw, thick] (asdf3) at (12,-2.5) {$(y_{t+2}, id_{t+2})$}; \node[align=center, circle, draw, ultra thick, minimum size=4.25em] (s3_3) at (8.5,1) {$s_3$\\{\scriptsize$\beta_{t+1}(s_3)$}} edge[gray, thin, stealth-] (s1_2) edge[gray, thin, stealth-] (s3_2) edge[gray, thin, stealth-] (s4_2); \draw[-stealth, very thick, dashed, bend left=90] (asdf2.west) to node[pos=0.33, align=center, fill=white] {${\bf O'}_{3,id_{t+1}}$\\$\mathcal{N}(y_{t+1};\mu_{id_{t+1}},\sigma_{id_{t+1}})$} (s3_3.west); \node [draw, thick] (asdf2) at (8.5,-2.5) {$(y_{t+1}, id_{t+1})$}; \node at (8.5,6.5) {$t+1$}; \node[circle, draw, thick] (s1_3) at (8.5,5) {$s_1$} edge[gray, thin, stealth-] (s1_2) edge[gray, thin, stealth-] (s2_2) edge[gray, thin, stealth-] (s3_2) edge[gray, thin, stealth-] (s4_2); \node[circle, draw, thick] (s2_3) at (8.5,3) {$s_2$} edge[gray, thin, stealth-] (s1_2) edge[gray, thin, stealth-] (s2_2) edge[gray, thin, stealth-] (s3_2) edge[gray, thin, stealth-] (s4_2); \node[circle, draw, thick] (s4_3) at (8.5,-1) {$s_4$} edge[gray, thin, stealth-] (s1_2) edge[gray, thin, stealth-] (s2_2) edge[gray, thin, stealth-] (s3_2) edge[gray, thin, stealth-] (s4_2); % 4th column \node at (12,6.5) {$t+2$}; \node[align=center, circle, draw, thick] (s1_4) at (12,5) {$s_1$\\{\scriptsize$\beta_{t+2}(s_1)$}} edge[gray, thin, stealth-] (s1_3) edge[gray, thin, stealth-] (s2_3) edge[gray, thin, stealth-] (s4_3); \node[align=center, circle, draw, thick] (s2_4) at (12,3) {$s_2$\\{\scriptsize$\beta_{t+2}(s_2)$}} edge[gray, thin, stealth-] (s1_3) edge[gray, thin, stealth-] (s2_3) edge[gray, thin, stealth-] (s4_3); \node[align=center, circle, draw, thick] (s3_4) at (12,1) {$s_3$\\{\scriptsize$\beta_{t+2}(s_3)$}} edge[gray, thin, stealth-] (s1_3) edge[gray, thin, stealth-] (s2_3) edge[gray, thin, stealth-] (s4_3); \node[align=center, circle, draw, thick] (s4_4) at (12,-1) {$s_4$\\{\scriptsize$\beta_{t+2}(s_4)$}} edge[gray, thin, stealth-] (s1_3) edge[gray, thin, stealth-] (s2_3) edge[gray, thin, stealth-] (s4_3); \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{12}$} (s1_1); \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{22}$} (s2_1); \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{32}$} (s3_1); \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{42}$} (s4_1); \draw[very thick, stealth-] (s1_4) to node [midway, fill=white] {${\bf T}_{31}$} (s3_3); \draw[very thick, stealth-] (s2_4) to node [midway, fill=white] {${\bf T}_{32}$} (s3_3); \draw[very thick, stealth-] (s3_4) to node [midway, fill=white] {${\bf T}_{33}$} (s3_3); \draw[very thick, stealth-] (s4_4) to node [midway, fill=white] {${\bf T}_{34}$} (s3_3); \draw[very thick, stealth-] (s3_3) to node [midway, fill=white] {${\bf T}_{23}$} (s2_2); \node [draw, thick] (asdf) at (3.5,-2.5) {$(y_{t}, id_{t})$}; \end{tikzpicture} \end{document}
\documentclass[crop,tikz]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,decorations.pathmorphing,positioning} \definecolor{olivegreen}{rgb}{0,0.6,0} \begin{document} \begin{tikzpicture} \node (1) [draw, dashed, minimum height=15em, minimum width=15em, xshift=6.5em, fill=olivegreen, fill opacity=0.2, very thick, rectangle, rounded corners] {}; \node (la1) [below=0em of 1] {\emph{encoder}}; \node (2) [draw, dashed, minimum height=14em, fill = red, fill opacity=0.2,minimum width=14em, xshift=19em, very thick, rectangle, rounded corners] {}; \node (la1) [below=0em of 2] {\emph{decoder}}; \node (3) [draw, dashed, minimum height=16em, fill = blue, fill opacity=0.2,minimum width=5em, xshift=-1.5em, very thick, rectangle, rounded corners] {}; \node (la3) [below=0em of 3] {\emph{corrupt}}; \node[circle, thick, fill=red!50, draw] (x1) {}; \node[circle, thick, draw, fill=red!50, below=1em of x1] (x2) {}; \node[circle, thick, fill=red!50, draw, below=1em of x2] (x3) {}; \node[circle, thick, fill=red!50, draw, below=1em of x3] (x4) {}; \node[circle, thick, fill=red!50, draw, above=1em of x1] (x5) {}; \node[circle, thick, fill=red!50, draw, above=1em of x5] (x6) {}; \node[circle, thick, fill=red!50, draw, above=1em of x6] (x7) {}; \foreach \x in {1,...,7} \node at (x\x) (lx\x) {$\sim$}; \node[circle, thick, fill=white, left=2em of x1, draw] (i1) {}; \node[circle, thick, draw, fill=white, below=1em of i1] (i2) {}; \node[circle, thick, fill=white, draw, below=1em of i2] (i3) {}; \node[circle, thick, fill=white, draw, below=1em of i3] (i4) {}; \node[circle, thick, fill=white, draw, above=1em of i1] (i5) {}; \node[circle, thick, fill=white, draw, above=1em of i5] (i6) {}; \node[circle, thick, fill=white, draw, above=1em of i6] (i7) {}; \foreach \x in {1,...,7} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (i\x) -- (x\x); \node[circle, thick, right=4em of x1, fill=white, draw] (xh1) {}; \node[circle, thick, draw, fill=white, below=1em of xh1] (xh2) {}; \node[circle, thick, fill=white, draw, below=1em of xh2] (xh3) {}; \node[circle, thick, fill=white, draw, above=1em of xh1] (xh4) {}; \node[circle, thick, fill=white, draw, above=1em of xh4] (xh5) {}; \node[circle, thick, fill=white, draw, right=8em of x1, yshift=5em] (hm1) {}; \node[circle, thick, draw, fill=white, below=0.5em of hm1] (hm2) {}; \node[circle, thick, draw, fill=white, below=0.5em of hm2] (hm3) {}; \node[circle, thick, draw, fill=white, above=0.5em of hm1] (hm4) {}; \node[circle, thick, fill=white, draw, right=8em of x1, yshift=-3em] (hs1) {}; \node[circle, thick, draw, fill=white, below=0.5em of hs1] (hs2) {}; \node[circle, thick, draw, fill=white, below=0.5em of hs2] (hs3) {}; \node[circle, thick, draw, fill=white, above=0.5em of hs1] (hs4) {}; \node[] at (hm1) (mu1) {$\mu$}; \node[] at (hm2) (mu2) {$\mu$}; \node[] at (hm3) (mu3) {$\mu$}; \node[] at (hm4) (mu4) {$\mu$}; \node[] at (hs1) (s1) {$\sigma$}; \node[] at (hs2) (s2) {$\sigma$}; \node[] at (hs3) (s3) {$\sigma$}; \node[] at (hs4) (s4) {$\sigma$}; \node[circle, thick, fill=lightgray, draw, right=12em of x1, yshift=1em] (h1) {}; \node[circle, thick, draw, fill=lightgray, below=1em of h1] (h2) {}; \node[circle, thick, draw, fill=lightgray, below=1em of h2] (h3) {}; \node[circle, thick, draw, fill=lightgray, above=1em of h1] (h4) {}; \node[circle, thick, right=16em of x1, fill=white, draw] (oh1) {}; \node[circle, thick, draw, fill=white, below=1em of oh1] (oh2) {}; \node[circle, thick, fill=white, draw, below=1em of oh2] (oh3) {}; \node[circle, thick, fill=white, draw, above=1em of oh1] (oh4) {}; \node[circle, thick, fill=white, draw, above=1em of oh4] (oh5) {}; \node[circle, thick, draw, fill=white, right=20em of x1] (o1) {}; \node[circle, thick, draw, fill=white, below=1em of o1] (o2) {}; \node[circle, thick, draw, fill=white, below=1em of o2] (o3) {}; \node[circle, thick, draw, fill=white, below=1em of o3] (o4) {}; \node[circle, thick, draw, fill=white, above=1em of o1] (o5) {}; \node[circle, thick, draw, fill=white, above=1em of o5] (o6) {}; \node[circle, thick, draw, fill=white, above=1em of o6] (o7) {}; \node[circle, thick, draw, fill=white, right=24em of x1] (oo1) {}; \node[circle, thick, draw, fill=white, below=1em of oo1] (oo2) {}; \node[circle, thick, draw, fill=white, below=1em of oo2] (oo3) {}; \node[circle, thick, draw, fill=white, below=1em of oo3] (oo4) {}; \node[circle, thick, draw, fill=white, above=1em of oo1] (oo5) {}; \node[circle, thick, draw, fill=white, above=1em of oo5] (oo6) {}; \node[circle, thick, draw, fill=white, above=1em of oo6] (oo7) {}; \node[] at (o1) (muu1) {$\mu$}; \node[] at (o2) (muu2) {$\mu$}; \node[] at (o3) (muu3) {$\mu$}; \node[] at (o4) (muu4) {$\mu$}; \node[] at (o5) (muu5) {$\mu$}; \node[] at (o6) (muu6) {$\mu$}; \node[] at (o7) (muu7) {$\mu$}; \foreach \x in {1,...,7} \foreach \y in {1,...,5} \draw[-stealth, thick] (x\x) -- (xh\y); \foreach \x in {1,...,5} \foreach \y in {1,...,4} \draw[-stealth, thick] (xh\x) -- (hm\y); \foreach \x in {1,...,5} \foreach \y in {1,...,4} \draw[-stealth, thick] (xh\x) -- (hs\y); \foreach \x in {1,...,4} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (hs\x) -- (h\x); \foreach \x in {1,...,4} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (hm\x) -- (h\x); \foreach \x in {1,...,5} \foreach \y in {1,...,4} \draw[-stealth, thick] (h\y) -- (oh\x); \foreach \x in {1,...,5} \foreach \y in {1,...,7} \draw[-stealth, thick] (oh\x) -- (o\y); \foreach \x in {1,...,7} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (o\x) -- (oo\x); \node[left=0.5em of i1] (l1) {$\vec{x}$}; \node[above=0em of h4] (l2) {$\vec{z}$}; \node[right=0.5em of oo1] (l3) {$\vec{x}'$}; \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \definecolor{mygreen}{HTML}{006400} \begin{document} \begin{tikzpicture}[node distance=2.8em] \node[circle, thick, fill=red, draw] (0) {}; \node[circle, thick, below left=of 0, fill=red, draw] (1) {}; \node[circle, thick, below right=of 0, fill=red, draw] (2) {}; \node[circle, thick, below right=of 1, fill=red, draw] (3) {}; \node[circle, thick, below left=of 3, fill=red, draw] (4) {}; \node[circle, thick, below right=of 3, fill=red, draw] (5) {}; \node[circle, thick, below right=of 4, fill=red, draw] (6) {}; \node[circle, thick, right=of 5, fill=mygreen, draw] (7) {}; \node[circle, thick, above right=of 7, fill=mygreen, draw] (8) {}; \node[circle, thick, below right=of 8, fill=mygreen, draw] (9) {}; \node[circle, thick, below right=of 7, fill=mygreen, draw] (10) {}; \node[circle, thick, below left=of 10, fill=mygreen, draw] (11) {}; \node[circle, thick, below right=of 10, fill=mygreen, draw] (12) {}; \node[circle, thick, above right=of 9, fill=blue, draw] (13) {}; \node[circle, thick, above right=of 13, fill=blue, draw] (16) {}; \node[circle, thick, above left=of 16, fill=blue, draw] (14) {}; \node[circle, thick, above right=of 14, fill=blue, draw] (15) {}; \node[circle, thick, above right=of 16, fill=blue, draw] (17) {}; \node[circle, thick, below right=of 16, fill=blue, draw] (18) {}; \path[-stealth, very thick] (0) edge [->, >=stealth, opacity=0.02, loop above] (0); \draw[very thick, opacity=0.30, -stealth] (0) -- (1); \draw[very thick, opacity=0.07, -stealth] (0) -- (2); \draw[very thick, opacity=0.53, -stealth] (0) -- (3); \draw[very thick, opacity=0.02, -stealth] (0) -- (4); \draw[very thick, opacity=0.05, -stealth] (0) -- (5); \path[-stealth, very thick] (1) edge [->, >=stealth, opacity=0.56, loop left] (1); \draw[very thick, opacity=0.25, -stealth] (1) -- (2); \draw[very thick, opacity=0.11, -stealth] (1) -- (3); \draw[very thick, opacity=0.02, -stealth] (1) -- (4); \draw[very thick, opacity=0.05, -stealth] (1) -- (5); \draw[very thick, opacity=0.54, -stealth] (2) -- (1); \path[-stealth, very thick] (2) edge [->, >=stealth, opacity=0.31, loop right] (2); \draw[very thick, opacity=0.04, -stealth] (2) -- (3); \draw[very thick, opacity=0.03, -stealth] (2) -- (4); \draw[very thick, opacity=0.07, -stealth] (2) -- (5); \draw[very thick, opacity=0.35, -stealth] (3) -- (1); \draw[very thick, opacity=0.09, -stealth] (3) -- (2); \path[-stealth, very thick] (3) edge [->, >=stealth, opacity=0.44, loop right] (3); \draw[very thick, opacity=0.03, -stealth] (3) -- (4); \draw[very thick, opacity=0.08, -stealth] (3) -- (5); \draw[very thick, opacity=0.22, -stealth] (4) -- (1); \draw[very thick, opacity=0.07, -stealth] (4) -- (2); \draw[very thick, opacity=0.05, -stealth] (4) -- (3); \path[-stealth, very thick] (4) edge [->, >=stealth, opacity=0.19, loop left] (4); \draw[very thick, opacity=0.46, -stealth] (4) -- (5); \draw[very thick, opacity=0.38, -stealth] (5) -- (1); \draw[very thick, opacity=0.09, -stealth] (5) -- (2); \draw[very thick, opacity=0.12, -stealth] (5) -- (3); \draw[very thick, opacity=0.10, -stealth] (5) -- (4); \path[-stealth, very thick] (5) edge [->, >=stealth, opacity=0.31, loop below] (5); \draw[very thick, opacity=0.31, -stealth] (6) -- (1); \draw[very thick, opacity=0.08, -stealth] (6) -- (2); \draw[very thick, opacity=0.46, -stealth] (6) -- (3); \draw[very thick, opacity=0.04, -stealth] (6) -- (4); \draw[very thick, opacity=0.10, -stealth] (6) -- (5); \path[-stealth, very thick] (7) edge [->, >=stealth, opacity=0.32, loop above] (7); \draw[very thick, opacity=0.10, -stealth] (7) -- (8); \draw[very thick, opacity=0.12, -stealth] (7) -- (9); \draw[very thick, opacity=0.36, -stealth] (7) -- (10); \draw[very thick, opacity=0.07, -stealth] (7) -- (11); \draw[very thick, opacity=0.03, -stealth] (7) -- (12); \draw[very thick, opacity=0.28, -stealth] (8) -- (7); \path[-stealth, very thick] (8) edge [->, >=stealth, opacity=0.11, loop above] (8); \draw[very thick, opacity=0.13, -stealth] (8) -- (9); \draw[very thick, opacity=0.37, -stealth] (8) -- (10); \draw[very thick, opacity=0.07, -stealth] (8) -- (11); \draw[very thick, opacity=0.03, -stealth] (8) -- (12); \draw[very thick, opacity=0.03, -stealth] (9) -- (7); \draw[very thick, opacity=0.01, -stealth] (9) -- (8); \path[-stealth, very thick] (9) edge [->, >=stealth, opacity=0.48, loop above] (9); \draw[very thick, opacity=0.27, -stealth] (9) -- (10); \draw[very thick, opacity=0.21, -stealth] (9) -- (11); \draw[very thick, opacity=0.10, -stealth] (10) -- (7); \draw[very thick, opacity=0.04, -stealth] (10) -- (8); \draw[very thick, opacity=0.31, -stealth] (10) -- (9); \path[-stealth, very thick] (10) edge [->, >=stealth, opacity=0.39, loop right] (10); \draw[very thick, opacity=0.15, -stealth] (10) -- (11); \draw[very thick, opacity=0.04, -stealth] (11) -- (7); \draw[very thick, opacity=0.01, -stealth] (11) -- (8); \draw[very thick, opacity=0.45, -stealth] (11) -- (9); \draw[very thick, opacity=0.29, -stealth] (11) -- (10); \path[-stealth, very thick] (11) edge [->, >=stealth, opacity=0.20, loop left] (11); \draw[very thick, opacity=0.36, -stealth] (12) -- (7); \draw[very thick, opacity=0.13, -stealth] (12) -- (8); \draw[very thick, opacity=0.08, -stealth] (12) -- (9); \draw[very thick, opacity=0.34, -stealth] (12) -- (10); \draw[very thick, opacity=0.05, -stealth] (12) -- (11); \path[-stealth, very thick] (12) edge [->, >=stealth, opacity=0.04, loop right] (12); \path[-stealth, very thick] (13) edge [->, >=stealth, opacity=0.12, loop below] (13); \draw[very thick, opacity=0.03, -stealth] (13) -- (14); \draw[very thick, opacity=0.52, -stealth] (13) -- (16); \draw[very thick, opacity=0.32, -stealth] (13) -- (17); \draw[very thick, opacity=0.01, -stealth] (14) -- (13); \path[-stealth, very thick] (14) edge [->, >=stealth, opacity=0.19, loop left] (14); \draw[very thick, opacity=0.65, -stealth] (14) -- (16); \draw[very thick, opacity=0.11, -stealth] (14) -- (17); \draw[very thick, opacity=0.02, -stealth] (14) -- (18); \draw[very thick, opacity=0.04, -stealth] (15) -- (13); \draw[very thick, opacity=0.13, -stealth] (15) -- (14); \path[-stealth, very thick] (15) edge [->, >=stealth, opacity=0.01, loop right] (15); \draw[very thick, opacity=0.62, -stealth] (15) -- (16); \draw[very thick, opacity=0.18, -stealth] (15) -- (17); \draw[very thick, opacity=0.01, -stealth] (15) -- (18); \draw[very thick, opacity=0.03, -stealth] (16) -- (13); \draw[very thick, opacity=0.09, -stealth] (16) -- (14); \path[-stealth, very thick] (16) edge [->, >=stealth, opacity=0.69, loop below] (16); \draw[very thick, opacity=0.18, -stealth] (16) -- (17); \draw[very thick, opacity=0.07, -stealth] (17) -- (13); \draw[very thick, opacity=0.05, -stealth] (17) -- (14); \draw[very thick, opacity=0.61, -stealth] (17) -- (16); \path[-stealth, very thick] (17) edge [->, >=stealth, opacity=0.26, loop right] (17); \draw[very thick, opacity=0.01, -stealth] (18) -- (13); \draw[very thick, opacity=0.25, -stealth] (18) -- (14); \draw[very thick, opacity=0.01, -stealth] (18) -- (15); \draw[very thick, opacity=0.61, -stealth] (18) -- (16); \draw[very thick, opacity=0.09, -stealth] (18) -- (17); \path[-stealth, very thick] (18) edge [->, >=stealth, opacity=0.03, loop below] (18); \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{positioning, decorations.pathmorphing} \definecolor{mynavy}{HTML}{000080} \definecolor{darkred}{HTML}{8B0000} \definecolor{mygreen}{HTML}{006400} \definecolor{mygold}{HTML}{B8860B} \newcommand{\myGlobalTransformation}[2] { \pgftransformcm{1}{0}{0.4}{0.5}{\pgfpoint{#1cm}{#2cm}} } \tikzstyle myBG=[line width=3pt,opacity=1.0] \begin{document} \begin{tikzpicture} \begin{scope} \myGlobalTransformation{0}{0}; \draw [black!50,fill=red!5] rectangle (8,8); \end{scope} \begin{scope} \myGlobalTransformation{0}{4.25}; \draw [black!50,fill=blue!5] rectangle (8,8); \end{scope} \begin{scope} \myGlobalTransformation{0}{0}; \node (thisNode) at (1,3) {}; { \pgftransformreset \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); \draw[black,very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (thisNode) -- ++(0,4.25); } \node (thisNode) at (3,5) {}; { \pgftransformreset \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); } \node (thisNode) at (5,7) {}; { \pgftransformreset \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); } \node (thisNode) at (7,7) {}; { \pgftransformreset \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); } \end{scope} \begin{scope} \myGlobalTransformation{0}{0} \node (N1) at (1,3) [circle,white,fill=mynavy] {$S$}; \node (N2) at (3,5) [circle,white,fill=darkred] {$I$}; \node (N3) at (5,1) [circle,white,fill=mygreen] {$V$}; \node (N4) at (5,7) [circle,white,fill=mynavy] {$S$}; \node (N5) at (7,3) [circle,white,fill=darkred] {$I$}; \node (N6) at (7,7) [circle,white,fill=mynavy] {$S$}; \draw[-, darkred!10, very thick] (N3) -- (N6); \draw[-, darkred!15, very thick] (N2) -- (N4); \draw[-, darkred!20, very thick] (N2) -- (N6); \draw[-, darkred!30, very thick] (N1) -- (N5); \draw[-, darkred!50, very thick] (N2) -- (N5); \draw[-, darkred!66, very thick] (N4) -- (N5); \draw[-, darkred!70, very thick] (N1) -- (N3); \draw[-, darkred!70, very thick] (N5) -- (N6); \draw[-, darkred!75, very thick] (N3) -- (N4); \draw[-, darkred!90, very thick] (N1) -- (N2); \draw[-, darkred!90, very thick] (N4) -- (N6); \draw[-, darkred, very thick] (N2) -- (N3); \draw[-, darkred, very thick] (N3) -- (N5); \end{scope} \begin{scope} \myGlobalTransformation{0}{4.25} \node (N1) at (1,3) [circle,white,fill=magenta] {$U$}; \node (N2) at (3,5) [circle,white,fill=mygold] {$A$}; \node (N3) at (5,1) [circle,white,fill=mygold] {$A$}; \node (N4) at (5,7) [circle,white,fill=magenta] {$U$}; \node (N5) at (7,3) [circle,white,fill=magenta] {$U$}; \node (N6) at (7,7) [circle,white,fill=mygold] {$A$}; \draw[-, mynavy, very thick] (N1) -- (N2); \draw[-, mynavy, very thick] (N1) -- (N3); \draw[-, cyan, very thick] (N1) -- (N5); \draw[-, blue, very thick] (N2) -- (N3); \draw[-, mynavy, very thick] (N2) -- (N4); \draw[-, mynavy, very thick] (N2) -- (N5); \draw[-, blue, very thick] (N2) -- (N6); \draw[-, mynavy, very thick] (N3) -- (N4); \draw[-, mynavy, very thick] (N3) -- (N5); \draw[-, blue, very thick] (N3) -- (N6); \draw[-, cyan, very thick] (N4) -- (N5); \draw[-, mynavy, very thick] (N4) -- (N6); \draw[-, mynavy, very thick] (N5) -- (N6); \end{scope} \begin{scope} \myGlobalTransformation{0}{0}; \node (thisNode) at (5,1) {}; { \pgftransformreset \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); } \node (thisNode) at (7,3) {}; { \pgftransformreset \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); } \end{scope} \begin{scope} \myGlobalTransformation{0}{0} \node (N3) at (5,1) [circle,white,fill=mygreen] {$V$}; \node (N5) at (7,3) [circle,white,fill=darkred] {$I$}; \end{scope} \begin{scope} \myGlobalTransformation{0}{4.25} \node (N3) at (5,1) [circle,white,fill=mygold] {$A$}; \node (N5) at (7,3) [circle,white,fill=magenta] {$U$}; \end{scope} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,ultra thick] (0, 0.2) -- node [above=1em,rotate=90] {self-awareness} (0, 4); \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,ultra thick] (11.3, 8.1) -- node [above=1em,rotate=-90] {immunisation} (11.3, 4.2); \node at (10, 0.3) {\emph{\textbf{epidemics layer}}}; \node at (1.2, 8) {\emph{\textbf{awareness layer}}}; \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{positioning, matrix, backgrounds} \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em] \definecolor{mygreen}{rgb}{0,0.6,0} \definecolor{echodrk}{HTML}{0099cc} \begin{document} \begin{tikzpicture}[node distance=3cm, auto] \draw[opacity=0] (-6, -3.5) rectangle (4, 3.3); \begin{scope}[shift={(-4,-2)},transform canvas={scale=0.7}] \node [block, color=black, very thick, fill=lightgray!70, minimum height=15em, text width=20em] (cpu) {}; \node [above left] (lab) at (cpu.south east) {\LARGE \bf CPU}; \node [below right=2.5em, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (PC) at (cpu.north west) {\tt 13}; \node[below=0.1em of PC] (lPC) {\tt PC}; \node [right=1em of PC, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (SP) {\tt 25}; \node[below=0.1em of SP] (lSP) {\tt SP}; \node [right=1em of SP, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (A) {\tt 1}; \node[below=0.1em of A] (lA) {\tt A}; \node [right=1em of A, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (B) {\tt 7}; \node[below=0.1em of B] (lB) {\tt B}; \node [right=1em of B, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (C) {\tt 3}; \node[below=0.1em of C] (lC) {\tt C}; \node [right=0.6em of C] (etc) {\Huge \dots}; \node [below=1.5em of PC, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (ZF) {\tt F}; \node[below=0.1em of ZF] (lZF) {\tt ZF}; \node [right=1em of ZF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (OF) {\tt T}; \node[below=0.1em of OF] (lOF) {\tt OF}; \node [right=1em of OF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (HCF) {\tt F}; \node[below=0.1em of HCF] (lHCF) {\tt HCF}; \node [right=1em of HCF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (CF) {\tt F}; \node[below=0.1em of CF] (lCF) {\tt CF}; \node [right=1em of CF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=5em] (tkz) {\tt 15739}; \node[below=0.1em of tkz] (ltkz) {\tt ticks}; \coordinate (PC) at (-0.5, 2); \coordinate (A) at (1.1, 2); \coordinate (ZF) at (-0.5, 0.6); \coordinate (OF) at (0.3, 0.6); \coordinate (HCF) at (1.1, 0.6); \coordinate (CF) at (1.9, 0.6); \coordinate (tkz) at (3.4, 1.0); \end{scope} \begin{scope}[font=\ttfamily, array/.style={matrix of nodes,nodes={draw, minimum size=7mm, fill=green!30},column sep=-\pgflinewidth, row sep=0.5mm, nodes in empty cells, row 2/.style={nodes={draw=none, fill=none, minimum size=5mm}}}, shift={(-2.9,2)},transform canvas={scale=1.0}] \matrix[array,ampersand replacement=\&] (array) { 6 \& 12 \& 1 \& 214 \& 5 \& 0 \& 255 \& 4 \\ {\tiny \dots} \& 9 \& 10 \& 11 \& 12 \& 13 \& 14 \& {\tiny \dots}\\}; \begin{scope}[on background layer] \fill[green!10] (array-2-1.north west) rectangle (array-2-8.south east); \end{scope} \draw[<->, opacity=0.0]([yshift=0mm]array-1-1.north west) -- node[above,color=black, opacity=1.0] {Memory} ([yshift=0mm]array-1-8.north east); \node[draw, fill=red, opacity=0.5, minimum size=6mm] at (array-1-5) (box) {}; \draw (array-2-8.east)--++(0:3mm) node [right]{Address}; \draw[-stealth, ultra thick, red] (PC) -- (array-2-5); \node[] (subi) at (6, -2) {\tt Sub(A, \textcolor{red}{5})}; \draw[-stealth, ultra thick, mygreen] (box) -- (subi); \path[-stealth, ultra thick, echodrk] (subi.west) edge[bend right=20] (A); \path[-stealth, ultra thick, echodrk] (subi.west) edge[bend right=20] (PC); \draw[-stealth, ultra thick, echodrk] (subi) -- (tkz); \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (ZF); \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (OF); \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (HCF); \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (CF); \end{scope} \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usepackage{amsmath} \usepackage{amssymb} \usepackage{xcolor} \usetikzlibrary{positioning, decorations.pathmorphing} \definecolor{olivegreen}{rgb}{0,0.6,0} \begin{document} \begin{tikzpicture} \path[rounded corners, fill=blue, fill opacity=0.2] (-0.4, 3.5) -- (-0.4, -3.5) -- (4, -3.5) -- (4, -0.2) -- (5, -0.2) -- (5, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \path[rounded corners, fill=red, fill opacity=0.2] (-0.4, -3.5) -- (-0.4, 3.5) -- (4, 3.5) -- (4, -0.2) -- (5, -0.2) -- (5, -3.5) -- (-0.4, -3.5) -- (-0.4, 0); \path[rounded corners, fill=white] (-0.4, 0) -- (-0.4, -3.5) -- (4, -3.5) -- (4, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \path[rounded corners, fill=olivegreen, fill opacity=0.2] (-0.4, 0) -- (-0.4, -3.5) -- (4, -3.5) -- (4, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \path [draw, dashed, very thick, rectangle, rounded corners] (-0.4, 0) -- (-0.4, -3.5) -- (5, -3.5) -- (5, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \node[circle, thick, fill=white, draw] (x1) {}; \node[circle, thick, draw, fill=white, below=1em of x1] (x2) {}; \node[circle, thick, fill=white, draw, below=1em of x2] (x3) {}; \node[circle, thick, fill=white, draw, below=1em of x3] (x4) {}; \node[circle, thick, fill=white, draw, below=1em of x4] (x5) {}; \node[circle, thick, fill=white, draw, above=1em of x1] (x6) {}; \node[circle, thick, fill=white, draw, above=1em of x6] (x7) {}; \node[circle, thick, fill=white, draw, above=1em of x7] (x8) {}; \node[circle, thick, fill=white, draw, above=1em of x8] (x9) {}; \node[circle, thick, right=4em of x1, fill=white, draw] (xhh1) {}; \node[circle, thick, draw, fill=white, below=1em of xhh1] (xhh2) {}; \node[circle, thick, fill=white, draw, below=1em of xhh2] (xhh3) {}; \node[circle, thick, fill=white, draw, below=1em of xhh3] (xhh4) {}; \node[circle, thick, fill=white, draw, above=1em of xhh1] (xhh5) {}; \node[circle, thick, fill=white, draw, above=1em of xhh5] (xhh6) {}; \node[circle, thick, fill=white, draw, above=1em of xhh6] (xhh7) {}; \node[circle, thick, right=8em of x1, fill=white, draw] (xh1) {}; \node[circle, thick, draw, fill=white, below=1em of xh1] (xh2) {}; \node[circle, thick, fill=white, draw, below=1em of xh2] (xh3) {}; \node[circle, thick, fill=white, draw, below=1em of xh3] (xh4) {}; \node[circle, thick, fill=white, draw, above=1em of xh1] (xh5) {}; \node[circle, thick, fill=white, draw, above=1em of xh5] (xh6) {}; \node[circle, thick, fill=white, draw, above=1em of xh6] (xh7) {}; \node[circle, very thick, fill=blue!30, draw, right=12em of x1, yshift=5em] (hm1) {}; \node[circle, very thick, draw, fill=blue!30, below=0.5em of hm1] (hm2) {}; \node[circle, very thick, draw, fill=blue!30, below=0.5em of hm2] (hm3) {}; \node[circle, very thick, draw, fill=blue!30, above=0.5em of hm1] (hm4) {}; \node[circle, very thick, draw, fill=blue!30, above=0.5em of hm4] (hm5) {}; \node[circle, very thick, fill=red!30, draw, right=12em of x1, yshift=-5em] (hs1) {}; \node[right=1.5em of hm1, blue] (mu1) {$\pi_\theta(s, \alpha_3)$}; \node[right=1.5em of hm2, blue] (mu2) {$\pi_\theta(s, \alpha_4)$}; \node[right=1.5em of hm3, blue] (mu3) {$\pi_\theta(s, \alpha_5)$}; \node[right=1.5em of hm4, blue] (mu4) {$\pi_\theta(s, \alpha_2)$}; \node[right=1.5em of hm5, blue] (mu5) {$\pi_\theta(s, \alpha_1)$}; \node[right=1.5em of hs1, red] (s1) {$V_\psi(s)$}; \foreach \x in {1,...,9} \foreach \y in {1,...,7} \draw[-stealth, thick] (x\x) -- (xhh\y); \foreach \x in {1,...,7} \foreach \y in {1,...,7} \draw[-stealth, thick] (xhh\x) -- (xh\y); \foreach \x in {1,...,7} \foreach \y in {1,...,5} \draw[-stealth, thick, blue] (xh\x) -- (hm\y); \foreach \x in {1,...,7} \draw[-stealth, thick, red] (xh\x) -- (hs1); \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick, red] (hs1) -- (s1); \foreach \x in {1,...,5} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick, blue] (hm\x) -- (mu\x); \node[left=0.75em of x1] (l1) {$s$}; \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{amsbsy} \usetikzlibrary{automata, chains, decorations.pathmorphing, positioning} \definecolor{echodrk}{HTML}{0099cc} \begin{document} \begin{tikzpicture} [scale=1.3, every node/.style={transform shape},start chain=1 going right, start chain=2 going right] \node[state, fill=red!20, on chain=1, very thick, text depth=0pt] (1) {$s_0$}; \node[state, fill=red!20, on chain=1, very thick, text depth=0pt] (2) {$s_1$}; \node[state, fill=red!20, on chain=1, very thick, text depth=0pt] (3) {$s_2$}; \node[on chain=1] (md) {\dots}; \node[state, fill=red!20, on chain=1, very thick, text depth=0pt] (n) {$s_n$}; \draw[>=stealth, color=red, text=black, very thick, auto=right,loop above/.style={out=75,in=105,loop}, every loop] (1) edge node[above] {\footnotesize$\boldsymbol \omega_{11}$} (2) (2) edge node[above] {\footnotesize$\boldsymbol \omega_{11}$} (3) (3) edge node[above] {\footnotesize$\boldsymbol \omega_{11}$} (md) (md) edge node[above] {\footnotesize$\boldsymbol \omega_{11}$} (n); \node[rectangle, thick, fill=red!20, draw] at (-2, 1.7) (y1) {$id_0$}; \node[rectangle, thick, fill=red!20, draw] at (0, 1.7) (y2) {$id_1$}; \node[rectangle, thick, fill=red!20, draw] at (2, 1.7) (y3) {$id_2$}; \node at (4, 1.7) (ymd) {\dots}; \node[rectangle, thick, fill=red!20, draw] at (6, 1.7) (yn) {$id_n$}; \draw[-stealth, color=red, text=black, very thick, dashed] (1) edge node[right] {${\bf O'}_{0,id_0}^1$} (y1) (2) edge node[right] {${\bf O'}_{1,id_1}^1$} (y2) (3) edge node[right] {${\bf O'}_{2,id_2}^1$} (y3) (n) edge node[right] {${\bf O'}_{n,id_n}^1$} (yn); \node[rectangle, fill=red!20, draw, scale=0.2, minimum size=20em,above = 2cm of y1] at (-1, 2) (gauss1) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \node[rectangle, fill=red!20, draw, scale=0.2, minimum size=20em,above = 2cm of y2] at (1, 2) (gauss2) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \node[rectangle, fill=red!20, draw, scale=0.2, minimum size=20em,above = 2cm of y3] at (3, 2) (gauss3) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \node at (5, 4.7) (gaussmd) {\dots}; \node[rectangle, fill=red!20, draw, scale=0.2, minimum size=20em,above = 2cm of yn] at (7, 2) (gaussn) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \draw[-stealth, color=red, text=black, very thick, dotted] (y1) edge node[left] {$\mu_{id_0}^1$} node[right] {$\sigma_{id_0}^1$} (gauss1) (y2) edge node[left] {$\mu_{id_1}^1$} node[right] {$\sigma_{id_1}^1$} (gauss2) (y3) edge node[left] {$\mu_{id_2}^1$} node[right] {$\sigma_{id_2}^1$} (gauss3) (yn) edge node[left] {$\mu_{id_n}^1$} node[right] {$\sigma_{id_n}^1$} (gaussn); %%%%%% BOUNDARY %%%%%%% %%%%%% BOUNDARY %%%%%%% \node[state, fill=echodrk!20, on chain=2, very thick, text depth=0pt] (21) at (0, -2) {$s_0$}; \node[state, fill=echodrk!20, on chain=2, very thick, text depth=0pt] (22) {$s_1$}; \node[state, fill=echodrk!20, on chain=2, very thick, text depth=0pt] (23) {$s_2$}; \node[on chain=2] (2md) {\dots}; \node[state, fill=echodrk!20, on chain=2, very thick, text depth=0pt] (2n) {$s_n$}; \draw[>=stealth, color=blue, text=black, very thick, auto=right,loop above/.style={out=75,in=105,loop}, every loop] (21) edge node[below] {\footnotesize$\boldsymbol \omega_{22}$} (22) (22) edge node[below] {\footnotesize$\boldsymbol \omega_{22}$} (23) (23) edge node[below] {\footnotesize$\boldsymbol \omega_{22}$} (2md) (2md) edge node[below] {\footnotesize$\boldsymbol \omega_{22}$} (2n); \node[rectangle, thick, fill=echodrk!20, draw] at (-2, -3.7) (2y1) {$id_0$}; \node[rectangle, thick, fill=echodrk!20, draw] at (0, -3.7) (2y2) {$id_1$}; \node[rectangle, thick, fill=echodrk!20, draw] at (2, -3.7) (2y3) {$id_2$}; \node at (4, -3.7) (2ymd) {\dots}; \node[rectangle, thick, fill=echodrk!20, draw] at (6, -3.7) (2yn) {$id_n$}; \draw[-stealth, color=blue, text=black, very thick, dashed] (21) edge node[right] {${\bf O'}_{0,id_0}^2$} (2y1) (22) edge node[right] {${\bf O'}_{1,id_1}^2$} (2y2) (23) edge node[right] {${\bf O'}_{2,id_2}^2$} (2y3) (2n) edge node[right] {${\bf O'}_{n,id_n}^2$} (2yn); \node[rectangle, fill=echodrk!20, draw, scale=0.2, minimum size=20em,above = 2cm of 2y1] at (-1, -9.5) (2gauss1) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \node[rectangle, fill=echodrk!20, draw, scale=0.2, minimum size=20em,above = 2cm of 2y2] at (1, -9.5) (2gauss2) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \node[rectangle, fill=echodrk!20, draw, scale=0.2, minimum size=20em,above = 2cm of 2y3] at (3, -9.5) (2gauss3) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \node at (5, -6.8) (2gaussmd) {\dots}; \node[rectangle, fill=echodrk!20, draw, scale=0.2, minimum size=20em,above = 2cm of 2yn] at (7, -9.5) (2gaussn) { \begin{tikzpicture} \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; \end{axis} \end{tikzpicture} }; \draw[-stealth, color=blue, text=black, very thick, dotted] (2y1) edge node[left] {$\mu_{id_0}^2$} node[right] {$\sigma_{id_0}^2$} (2gauss1) (2y2) edge node[left] {$\mu_{id_1}^2$} node[right] {$\sigma_{id_1}^2$} (2gauss2) (2y3) edge node[left] {$\mu_{id_2}^2$} node[right] {$\sigma_{id_2}^2$} (2gauss3) (2yn) edge node[left] {$\mu_{id_n}^2$} node[right] {$\sigma_{id_n}^2$} (2gaussn); %%%% COMBO %%%%% \draw[-stealth, very thick, auto=right,decoration={snake, segment length=2mm, amplitude=0.5mm,post length=1.5mm}] (1) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{12}$} (22) (2) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{12}$} (23) (3) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{12}$} (2md) (md) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{12}$} (2n); \draw[-stealth, very thick, auto=right,decoration={snake, segment length=2mm, amplitude=0.5mm,post length=1.5mm}] (21) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{21}$} (2) (22) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{21}$} (3) (23) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{21}$} (md) (2md) edge[decorate] node[left, near start] {\footnotesize$\boldsymbol \omega_{21}$} (n); %%%% START STATES %%%%% \node[text depth=0pt] at (-2, -1) (S) {start}; \draw[-stealth, very thick, auto=right,decoration={snake, segment length=2mm, amplitude=0.5mm,post length=1.5mm}] (S) edge[decorate] node[above] {\footnotesize$\pi_1$} (1) (S) edge[decorate] node[below] {\footnotesize$\pi_2$} (21); \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing,positioning} \definecolor{mynavy}{HTML}{000080} \definecolor{darkred}{HTML}{8B0000} \newcommand{\myGlobalTransformation}[2] { \pgftransformcm{1}{0}{0.5}{0.25}{\pgfpoint{#1cm}{#2cm}} } \tikzstyle myBG=[line width=3pt,opacity=1.0] \begin{document} \begin{tikzpicture} \begin{scope} \myGlobalTransformation{0}{0}; \draw [black!50,fill=red!5] (-1, 0) rectangle (9,8); \end{scope} \begin{scope} \myGlobalTransformation{0}{4.25}; \draw [black!50,fill=blue!5] (-1, 0) rectangle (9,8); \end{scope} \begin{scope} \myGlobalTransformation{0}{0} \node (N1) at (1,1) [circle,white,fill=darkred] {}; \node (N2) at (1,3) [circle,white,fill=darkred] {}; \node (N3) at (1,5) [circle,white,fill=darkred] {}; \node (N4) at (1,7) [circle,white,fill=darkred] {}; \node (N5) at (4,1) [circle,white,fill=darkred] {}; \node (N6) at (4,3) [circle,white,fill=darkred] {}; \node (N7) at (4,5) [circle,white,fill=darkred] {}; \node (N8) at (4,7) [circle,white,fill=darkred] {}; \node (N9) at (7,1) [circle,white,fill=darkred] {}; \node (N10) at (7,3) [circle,white,fill=darkred] {}; \node (N11) at (7,5) [circle,white,fill=darkred] {}; \node (N12) at (7,7) [circle,white,fill=darkred] {}; \node (N13) at (8.5,1) {}; \node (N14) at (8.5,3) {}; \node (N15) at (8.5,5) {}; \node (N16) at (8.5,7) {}; \node (N0) at (-0.5,1) {}; \node (N00) at (-0.5,3) {}; \node (N000) at (-0.5,5) {}; \node (N0000) at (-0.5,7) {}; \foreach \x in {1,...,4} \foreach \y in {5,...,8} \draw[-stealth, darkred, very thick] (N\x) -- (N\y); \foreach \x in {5,...,8} \foreach \y in {9,...,12} \draw[-stealth, darkred, very thick] (N\x) -- (N\y); \draw[-stealth, darkred, very thick] (N9) -- (N13); \draw[-stealth, darkred, very thick] (N10) -- (N14); \draw[-stealth, darkred, very thick] (N11) -- (N15); \draw[-stealth, darkred, very thick] (N12) -- (N16); \draw[-stealth, darkred, very thick] (N0) -- (N1); \draw[-stealth, darkred, very thick] (N00) -- (N2); \draw[-stealth, darkred, very thick] (N000) -- (N3); \draw[-stealth, darkred, very thick] (N0000) -- (N4); \begin{scope} \pgftransformreset \myGlobalTransformation{0}{4.25}; \node (T9) at (7,1) {}; \node (T10) at (7,3) {}; \node (T11) at (7,5) {}; \node (T12) at (7,7) {}; \foreach \x in {5,...,8} \foreach \y in {9,...,12} \draw[-stealth,very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (N\x) -- (T\y); \end{scope} \end{scope} \begin{scope} \myGlobalTransformation{0}{4.25} \node (N1) at (1,1) [circle,white,fill=mynavy] {}; \node (N2) at (1,3) [circle,white,fill=mynavy] {}; \node (N3) at (1,5) [circle,white,fill=mynavy] {}; \node (N4) at (1,7) [circle,white,fill=mynavy] {}; \node (N5) at (4,1) [circle,white,fill=mynavy] {}; \node (N6) at (4,3) [circle,white,fill=mynavy] {}; \node (N7) at (4,5) [circle,white,fill=mynavy] {}; \node (N8) at (4,7) [circle,white,fill=mynavy] {}; \node (N13) at (8.5,1) {}; \node (N14) at (8.5,3) {}; \node (N15) at (8.5,5) {}; \node (N16) at (8.5,7) {}; \node (N0) at (-0.5,1) {}; \node (N00) at (-0.5,3) {}; \node (N000) at (-0.5,5) {}; \node (N0000) at (-0.5,7) {}; \begin{scope} \pgftransformreset \myGlobalTransformation{0}{0}; \node (T9) at (7,1) {}; \node (T10) at (7,3) {}; \node (T11) at (7,5) {}; \node (T12) at (7,7) {}; \foreach \x in {5,...,8} \foreach \y in {9,...,12} \draw[-stealth,very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (N\x) -- (T\y); \end{scope} \node (N9) at (7,1) [circle,white,fill=mynavy] {}; \node (N10) at (7,3) [circle,white,fill=mynavy] {}; \node (N11) at (7,5) [circle,white,fill=mynavy] {}; \node (N12) at (7,7) [circle,white,fill=mynavy] {}; \draw[-stealth, mynavy, very thick] (N0) -- (N1); \draw[-stealth, mynavy, very thick] (N00) -- (N2); \draw[-stealth, mynavy, very thick] (N000) -- (N3); \draw[-stealth, mynavy, very thick] (N0000) -- (N4); \foreach \x in {1,...,4} \foreach \y in {5,...,8} \draw[-stealth, mynavy, very thick] (N\x) -- (N\y); \foreach \x in {5,...,8} \foreach \y in {9,...,12} \draw[-stealth, mynavy, very thick] (N\x) -- (N\y); \draw[-stealth, mynavy, very thick] (N9) -- (N13); \draw[-stealth, mynavy, very thick] (N10) -- (N14); \draw[-stealth, mynavy, very thick] (N11) -- (N15); \draw[-stealth, mynavy, very thick] (N12) -- (N16); \end{scope} \node at (11, 0.3) {\emph{\textbf{stream 1}}}; \node at (1, 6) {\emph{\textbf{stream 2}}}; \node at (10.8, 3.5) {\emph{\textbf{$\times$-connections}}}; \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{positioning, matrix} \tikzset{ table/.style={ matrix of nodes, row sep=-\pgflinewidth, column sep=-\pgflinewidth, nodes={rectangle,draw=black,text width=0.05ex,align=center}, nodes in empty cells }, texto/.style={font=\footnotesize\sffamily}, title/.style={font=\small\sffamily} } \tikzset{ tablet/.style={ matrix of nodes, row sep=-\pgflinewidth, column sep=-\pgflinewidth, nodes={rectangle,draw=black,text width=2.25ex,align=center}, text height=1.625ex, text depth=0ex, nodes in empty cells }, texto/.style={font=\footnotesize\sffamily}, title/.style={font=\small\sffamily} } \tikzset{ tablett/.style={ matrix of nodes, row sep=-\pgflinewidth, column sep=-\pgflinewidth, nodes={rectangle, text width=0.05ex,align=center}, nodes in empty cells }, texto/.style={font=\footnotesize\sffamily}, title/.style={font=\small\sffamily} } \begin{document} \begin{tikzpicture}[node distance=0.5cm, auto] \matrix[table] (t1) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ }; \node[above = 0.01cm of t1] (c1) {Tile 1}; \matrix[table, right =of t1] (t2) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ }; \node[above = 0.01cm of t2] (c2) {Tile 2}; \matrix[table, right =of t2] (t3) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ }; \node[above = 0.01cm of t3] (c3) {Tile 3}; \matrix[tablet, below = 1cm of t1] (mp) { \node (1) {\tt 1}; & \node (2) {\tt 2}; & \node (22) {\tt 2}; & \node (3) {\tt 3}; & \dots \\ \vdots & \vdots & \vdots & \vdots & $\ddots$ \\ }; \node[below = 0.01cm of mp] (c4) {Background map}; \draw [-stealth, thick] (1.north) -- (t1.south) ; \draw [-stealth, thick] (2.north) -- (t2.south); \draw [-stealth, thick] (22.north) -- (t2.south); \draw [-stealth, thick] (3.north) -- (t3.south); \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, below right = 1.1cm and -1.5cm of t2] (bg1) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ }; \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg1] (bg2) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ }; \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg2] (bg3) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ }; \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg3] (bg4) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ }; \node[below right = 0.01cm and 0.03cm of bg1] (c5) {Background}; \draw [-stealth, white, ultra thick] (t1.south) -- (bg1.north) ; \draw [-stealth, white, ultra thick] (t2.south) -- (bg2.north); \draw [-stealth, white, ultra thick] (t2.south) -- (bg3.north); \draw [-stealth, thick] (t1.south) -- (bg1.north); \draw [-stealth, thick] (t2.south) -- (bg2.north); \draw [-stealth, thick] (t2.south) -- (bg3.north); \draw [-stealth, thick] (t3.south) -- (bg4.north); \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, below right = 1.1cm and -1.5cm of t2] (bg1) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ }; \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg1] (bg2) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ }; \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg2] (bg3) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ }; \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg3] (bg4) { & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ & & & |[fill=gray]| & |[fill=gray]| & & & \\ }; \end{tikzpicture} \end{document}
\documentclass[tikz]{standalone} \usetikzlibrary{decorations.markings,arrows} \begin{document} \begin{tikzpicture} % lattice \draw[->,ultra thick] (-2,0) -- (2,0); \draw[->,ultra thick] (0,-2) -- (0,2); \draw (-2,-2) grid (2,2); \node [draw,ultra thick,rectangle,minimum width=1cm,minimum height=1cm,label=below:$2 \pi$,label=right:$2 \pi$] at (0.5,0.5) {}; % square \begin{scope}[xshift=4cm,yshift=1cm] \draw[postaction={decorate},decoration={ markings, mark=at position .145 with {\arrow{latex}}, mark=at position .375 with {\arrow{latex}}, mark=at position .635 with {\arrowreversed{latex}}, mark=at position .875 with {\arrowreversed{latex}}, } ] (0,-1) -- +(2,0) -- +(2,2) -- +(0,2) -- cycle; \end{scope} % bracelet \begin{scope}[xshift=9.5cm,yshift=1cm] \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}} } ] (0,.25) -- ++(2,0); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}} } ] (0,-.25) -- ++(2,0); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (0,-.25) to[out=-120,in=0] (-.35,-.75) to[out=180,in=180] (-.35,.75) to[out=0,in=120] (0,.25); \draw (2,.25) to[out=120,in=0] (1.65,.75) -- (-.35,.75) (-.35,-.75) -- (1.65,-.75) to[out=0,in=-120] (2,-.25); \begin{scope} \clip (0,.25) rectangle (2,-.25); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrowreversed{latex}}, } ] (1.65,.75) to[out=180,in=180] (1.65,-.75); \end{scope} \end{scope} % cylinder \begin{scope}[xshift=14.7cm,yshift=1cm] \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (0,0) -- (2,0); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (0,0) arc[start angle=0,delta angle=-360,x radius=.35,y radius=.75]; \draw (2,0) arc[start angle=0,delta angle=-90,x radius=.35,y radius=.75] -- ++(-2,0); \draw (2,0) arc[start angle=0,delta angle=90,x radius=.35,y radius=.75] -- ++(-2,0); \end{scope} % long cylinder \begin{scope}[xshift=4cm,yshift=-1.2cm] \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (0,0) -- (3,0); \draw[postaction={decorate},decoration={ markings, mark=at position .6 with {\arrow{latex}}, } ] (0,0) arc[start angle=0,delta angle=-360,x radius=.15,y radius=.35]; \draw (3,0) arc[start angle=0,delta angle=-90,x radius=.15,y radius=.35] -- ++(-3,0); \draw (3,0) arc[start angle=0,delta angle=90,x radius=.15,y radius=.35] -- ++(-3,0); \end{scope} % open torus \begin{scope}[xshift=9cm,yshift=-1.7cm] \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (1,0) arc[start angle=0,delta angle=-360,x radius=.15,y radius=.35]; \draw (1,0) ++(-.15,-.35) .. controls +(170:1) and +(-90:.5) .. ++(-1.5,1) .. controls +(90:.5) and +(180:1) .. ++(2,1) .. controls +(0:1) and +(90:.5) .. ++(2,-1) .. controls +(-90:.5) and +(10:1) .. ++(-1.5,-1) coordinate (a); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (a) ++(-.15,.35) arc[start angle=0,delta angle=-360,x radius=-.15,y radius=.35]; \draw (1,0) ++(-.15,.35) .. controls +(170:.5) and +(-60:.25) .. ++(-.9,.5) coordinate (b); \draw (a) ++(0,.7) .. controls +(10:.5) and +(240:.25) .. ++(.9,.5) coordinate (c); \begin{scope} \clip (1,0) ++(-.15,.35) .. controls +(170:.5) and +(-60:.25) .. ++(-.9,.5) -- ++(0,2) -| (c) .. controls +(240:.25) and +(10:.5) .. ++(-.9,-.5); \draw (1,0) ++(-.15,-.35) ++(0,-.7) .. controls +(170:1) and +(-90:.5) .. ++(-1.5,.8) .. controls +(90:.5) and +(180:1) .. ++(2,1.2) .. controls +(0:1) and +(90:.5) .. ++(2,-1.2) .. controls +(-90:.5) and +(10:1) .. ++(-1.5,-.8); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (1,0) ++(-.15,-.35) ++(0,-.8) .. controls +(170:1) and +(-90:.5) .. ++(-1.5,.8) .. controls +(90:.5) and +(180:1.2) .. ++(2,1.5) .. controls +(0:1.2) and +(90:.5) .. ++(2,-1.5) .. controls +(-90:.5) and +(10:1) .. ++(-1.5,-.8); \end{scope} \begin{scope} \clip (a) ++(-.15,.35) arc[start angle=0,delta angle=-360,x radius=-.15,y radius=.35]; \draw (a) ++(-.15,.35) .. controls +(10:1) and +(-90:.5) .. ++(1.5,.8); \end{scope} \begin{scope} \clip (1,0) arc[start angle=0,delta angle=-360,x radius=.15,y radius=.35]; \draw (1,0) .. controls +(170:1) and +(-90:.5) .. ++(-1.5,.8); \end{scope} \end{scope} % torus \begin{scope}[xshift=14cm,yshift=-1.7cm] \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrowreversed{latex}}, } ] (1.5,.35) arc[start angle=90,end angle=-90,y radius=.35,x radius=.1]; \draw (1.5,-.35) .. controls +(180:1) and +(-90:.65) .. ++(-2,1) .. controls +(90:.65) and +(180:1) .. ++(2,1) .. controls +(0:1) and +(90:.65) .. ++(2,-1) .. controls +(-90:.65) and +(0:1) .. ++(-2,-1); \draw (1.5,.35) .. controls +(180:.5) and +(-50:.25) .. ++(-1.3,.35) coordinate (b); \draw (1.5,.35) .. controls +(0:.5) and +(230:.25) .. ++(1.3,.35) coordinate (c); \begin{scope} \clip (1.5,.35) .. controls +(180:.5) and +(-50:.25) .. ++(-1.3,.35) -- ++(0,2) -| (c) .. controls +(230:.25) and +(0:.5) .. ++(-1.3,-.35); \draw (1.5,-.35) ++(0,-.7) .. controls +(180:1) and +(-90:.65) .. ++(-1.5,1) .. controls +(90:.65) and +(180:1) .. ++(1.5,1) .. controls +(0:1) and +(90:.65) .. ++(1.5,-1) .. controls +(-90:.65) and +(0:1) .. ++(-1.5,-1); \draw[postaction={decorate},decoration={ markings, mark=at position .5 with {\arrow{latex}}, } ] (1.5,-.35) ++(0,-.6) .. controls +(180:1) and +(-90:.65) .. ++(-1.5,1) .. controls +(90:.65) and +(180:1) .. ++(1.5,1) .. controls +(0:1) and +(90:.65) .. ++(1.5,-1) .. controls +(-90:.65) and +(0:1) .. ++(-1.5,-1); \end{scope} \end{scope} \end{tikzpicture} \end{document}
\documentclass[tikz]{standalone} \usepackage{pgfplots,siunitx} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xmode=log, domain=1e17:1e21, ymax=1, enlargelimits=false, ylabel=$zT$, xlabel=Carrier concentration $n$ (\si{\per\centi\meter\cubed}), grid=both, width=12cm, height=8cm, decoration={name=none}, ] \addplot [ultra thick, smooth, red!85!black] coordinates { (1.174e+18, 0.2317) (1.551e+18, 0.2787) (2.016e+18, 0.3300) (2.549e+18, 0.3816) (3.171e+18, 0.4332) (3.891e+18, 0.4842) (4.697e+18, 0.5373) (5.623e+18, 0.5892) (6.714e+18, 0.6404) (8.017e+18, 0.6923) (9.650e+18, 0.7450) (1.178e+19, 0.7963) (1.461e+19, 0.8486) (1.878e+19, 0.8964) (2.481e+19, 0.9278) (3.279e+19, 0.9318) (4.334e+19, 0.9057) (5.515e+19, 0.8571) (6.662e+19, 0.8045) (7.767e+19, 0.7519) (8.859e+19, 0.7000) (1.008e+20, 0.6476) (1.143e+20, 0.5953) (1.290e+20, 0.5449) (1.447e+20, 0.4906) (1.628e+20, 0.4374) (1.837e+20, 0.3850) (2.101e+20, 0.3327) (2.436e+20, 0.2799) (2.887e+20, 0.2281) (3.594e+20, 0.1753) (4.674e+20, 0.1271) (6.178e+20, 0.08917) (8.167e+20, 0.06240) (1e+21, 0.05) } node[pos=0.48, anchor=north] {$zT$}; \addplot [ultra thick, smooth, blue!70!black] coordinates { (1.176e+18, 0.005689) (1.554e+18, 0.008070) (2.054e+18, 0.009285) (2.714e+18, 0.01216) (3.587e+18, 0.01561) (4.740e+18, 0.02190) (6.264e+18, 0.02984) (8.277e+18, 0.04013) (1.094e+19, 0.05127) (1.445e+19, 0.06820) (1.910e+19, 0.09120) (2.511e+19, 0.1191) (3.333e+19, 0.1593) (4.344e+19, 0.2072) (5.433e+19, 0.2587) (6.613e+19, 0.3123) (7.852e+19, 0.3739) (8.925e+19, 0.4266) (1.001e+20, 0.4779) (1.110e+20, 0.5310) (1.224e+20, 0.5824) (1.335e+20, 0.6359) (1.441e+20, 0.6893) (1.551e+20, 0.7425) (1.660e+20, 0.7960) (1.767e+20, 0.8478) (1.876e+20, 0.9009) (1.986e+20, 0.9532) (2.08e+20, 1) } node[pos=0.95, anchor=east] {$\sigma$}; \addplot [ultra thick, smooth, green!70!black] coordinates { (1.175e+18, 0.08187) (1.553e+18, 0.08218) (2.053e+18, 0.08379) (2.713e+18, 0.08472) (3.585e+18, 0.08684) (4.738e+18, 0.08916) (6.261e+18, 0.09142) (8.274e+18, 0.09411) (1.093e+19, 0.09912) (1.445e+19, 0.1059) (1.909e+19, 0.1145) (2.523e+19, 0.1256) (3.334e+19, 0.1391) (4.405e+19, 0.1576) (5.821e+19, 0.1830) (7.691e+19, 0.2164) (1.016e+20, 0.2605) (1.302e+20, 0.3102) (1.589e+20, 0.3629) (1.882e+20, 0.4143) (2.181e+20, 0.4641) (2.472e+20, 0.5181) (2.764e+20, 0.5714) (3.066e+20, 0.6246) (3.363e+20, 0.6780) (3.669e+20, 0.7310) (3.981e+20, 0.7826) (4.273e+20, 0.8389) (4.560e+20, 0.8942) (4.868e+20, 0.9493) (5.2e+20, 1) } node[pos=0.95, anchor=west] {$\kappa$}; \addplot [ultra thick, smooth, orange] coordinates { (1.65e+18, 1) (1.931e+18, 0.9729) (2.553e+18, 0.9248) (3.375e+18, 0.8777) (4.462e+18, 0.8302) (5.899e+18, 0.7816) (7.745e+18, 0.7351) (1.031e+19, 0.6866) (1.363e+19, 0.6397) (1.802e+19, 0.5897) (2.382e+19, 0.5412) (3.149e+19, 0.4937) (4.162e+19, 0.4471) (5.503e+19, 0.3977) (7.117e+19, 0.3500) (9.181e+19, 0.2944) (1.224e+20, 0.2436) (1.618e+20, 0.2019) (2.138e+20, 0.1687) (2.826e+20, 0.1389) (3.736e+20, 0.1161) (4.938e+20, 0.09646) (6.321e+20, 0.08022) (8.578e+20, 0.06624) (1e+21, 0.06) } node[pos=0.1, anchor=south west] {$S$}; \addplot [ultra thick, smooth, cyan] coordinates { (1.159e+18, 0.04006) (1.532e+18, 0.04739) (2.025e+18, 0.05790) (2.676e+18, 0.06974) (3.386e+18, 0.08033) (4.675e+18, 0.09928) (6.179e+18, 0.1176) (8.168e+18, 0.1379) (1.080e+19, 0.1608) (1.427e+19, 0.1864) (1.886e+19, 0.2142) (2.492e+19, 0.2430) (3.294e+19, 0.2713) (4.353e+19, 0.2989) (5.754e+19, 0.3230) (7.605e+19, 0.3422) (1.005e+20, 0.3528) (1.314e+20, 0.3509) (1.757e+20, 0.3326) (2.327e+20, 0.3049) (3.071e+20, 0.2777) (4.061e+20, 0.2535) (5.369e+20, 0.2304) (7.098e+20, 0.2095) (1e+21, 0.185) } node[pos=0.4, anchor=south east] {$S^2 \sigma$}; \end{axis} \end{tikzpicture} \end{document}
\documentclass[tikz]{standalone} \usetikzlibrary{patterns,decorations.markings} \tikzset{ cross/.style={fill=white,path picture={\draw[black] (path picture bounding box.south east) -- (path picture bounding box.north west) (path picture bounding box.south west) -- (path picture bounding box.north east);}}, dressed/.style={fill=white,postaction={pattern=north east lines}}, momentum/.style 2 args={->,semithick,yshift=5pt,shorten >=5pt,shorten <=5pt}, loop/.style 2 args={thick,decoration={markings,mark=at position {#1} with {\arrow{>},\node[anchor=\pgfdecoratedangle-90,font=\footnotesize] {$p_{#2}$};}},postaction={decorate}}, label/.style={thin,gray,shorten <=-1.5ex} } \def\lrad{5/4} \def\mrad{0.15*\lrad} \def\srad{0.1*\lrad} \begin{document} % Diagram 1 \begin{tikzpicture} % Loop \draw[loop/.list={{0.0625}{6},{0.0625*3}{1},{0.0625*5}{2},{0.0625*7}{3},{0.0625*10}{4},{0.0625*14}{5}}] (0,0) circle (\lrad); \draw[cross] (0,\lrad) circle (\srad) node[above=5pt] {$\partial_k R_{k,ij}(p_1,p_2)$}; \draw[dressed] (135:\lrad) circle (\srad) node[above left] {$G_{k,jk}(p_2,p_3)$}; \draw[dressed] (45:\lrad) circle (\srad) node[above right] {$G_{k,ni}(p_6,p_1)$}; \draw[dressed] (0,-\lrad) circle (\srad) node[below=3pt] {$G_{k,lm}(p_4,p_5)$}; % External lines \draw (-2*\lrad,0) coordinate (xl) -- (-\lrad,0) node[pos=0.4,below] {$\varphi_a$}; \draw[momentum] (-2*\lrad,0) -- (-1.25*\lrad,0) node[midway,above] {$q_1$}; \draw (\lrad,0) -- (2*\lrad,0) coordinate (xr) node[pos=0.6,below] {$\varphi_b$}; \draw[momentum] (1.25*\lrad,0) -- (2*\lrad,0) node[midway,above] {$q_2$}; % Vertices \node at (-1.6*\lrad,-\lrad) (Gkail) {$\Gamma_{k,akl}^{(3)}(q_1,p_3,-p_4)$}; \draw[label] (Gkail) -- (-\lrad,0); \draw[dressed] (-\lrad,0) circle (\mrad); \node at (2*\lrad,-\lrad) (Gkbde) {$\Gamma_{k,bmn}^{(3)}(-q_2,p_5,-p_6)$}; \draw[label] (Gkbde.150) -- (\lrad,0); \draw[dressed] (\lrad,0) circle (\mrad); \end{tikzpicture} % Diagram 2 \begin{tikzpicture} % Loop \draw[loop/.list={{0.0625*2}{6},{0.0625*6}{3},{0.0625*9}{4},{0.0625*11}{1},{0.0625*13}{2},{0.0625*15}{5}}] (0,0) circle (\lrad); \draw[cross] (0,-\lrad) circle (\srad) node[below=5pt] {$\partial_k R_{k,ij}(p_1,p_2)$}; \draw[dressed] (-45:\lrad) circle (\srad) node[below right] {$G_{k,jm}(p_2,p_5)$}; \draw[dressed] (-135:\lrad) circle (\srad) node[below left] {$G_{k,li}(p_4,p_1)$}; \draw[dressed] (0,\lrad) circle (\srad) node[above=3pt] {$G_{k,nk}(p_6,p_3)$}; % External lines \draw (-2*\lrad,0) coordinate (xl) -- (-\lrad,0) node[pos=0.4,below] {$\varphi_a$}; \draw[momentum] (-2*\lrad,0) -- (-1.25*\lrad,0) node[midway,above] {$q_1$}; \draw (\lrad,0) -- (2*\lrad,0) coordinate (xr) node[pos=0.6,below] {$\varphi_b$}; \draw[momentum] (1.25*\lrad,0) -- (2*\lrad,0) node[midway,above] {$q_2$}; % Vertices \node at (-1.8*\lrad,\lrad) (Gkail) {$\Gamma_{k,akl}^{(3)}(q_1,p_3,-p_4)$}; \draw[label] (Gkail) -- (-\lrad,0); \draw[dressed] (-\lrad,0) circle (\mrad); \node at (1.8*\lrad,\lrad) (Gkbde) {$\Gamma_{k,bmn}^{(3)}(-q_2,p_5,-p_6)$}; \draw[label] (Gkbde) -- (\lrad,0); \draw[dressed] (\lrad,0) circle (\mrad); \end{tikzpicture} % Diagram 3 \begin{tikzpicture} % Loop \draw[loop/.list={{0.0625*2}{1},{0.0625*6}{2},{0.0625*10}{3},{0.0625*14}{4}}] (0,0) circle (\lrad); \draw[cross] (0,\lrad) circle (\srad) node[above=5pt] {$\partial_k R_{k,ij}(p_1,p_2)$}; \draw[dressed] (-\lrad,0) circle (\srad) node[left=2pt] {$G_{k,jk}(p_2,p_3)$}; \draw[dressed] (\lrad,0) circle (\srad) node[right=2pt] {$G_{k,li}(p_4,p_1)$}; % External lines \draw (-2.2*\lrad,-\lrad) -- (2.2*\lrad,-\lrad) node[pos=0.1,below] {$\varphi_a$} node[pos=0.9,below] {$\varphi_b$}; \draw[momentum] (-2*\lrad,-\lrad) -- (-\lrad,-\lrad) node[midway,above] {$q_1$}; \draw[momentum] (\lrad,-\lrad) -- (2*\lrad,-\lrad) node[midway,above] {$q_2$}; % Vertices \draw[dressed] (0,-\lrad) circle (\mrad) node[below] {$\Gamma_{k,abkl}^{(4)}(q_1,-q_2,p_3,-p_4)$}; \end{tikzpicture} \end{document}
\documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} % Gradient Info \tikzset {_4c6h9fmv2/.code = {\pgfsetadditionalshadetransform{ \pgftransformshift{\pgfpoint{0 bp } { 0 bp } } \pgftransformrotate{0 } \pgftransformscale{2 } }}} \pgfdeclarehorizontalshading{_w5gdki77u}{150bp}{rgb(0bp)=(1,1,1); rgb(37.5bp)=(1,1,1); rgb(62.5bp)=(0,0,0); rgb(100bp)=(0,0,0)} \tikzset{_flphwwo2w/.code = {\pgfsetadditionalshadetransform{\pgftransformshift{\pgfpoint{0 bp } { 0 bp } } \pgftransformrotate{0 } \pgftransformscale{2 } }}} \pgfdeclarehorizontalshading{_mxyd2nws7} {150bp} {color(0bp)=(transparent!0); color(37.5bp)=(transparent!0); color(62.5bp)=(transparent!10); color(100bp)=(transparent!10) } \pgfdeclarefading{_atyxpg39b}{\tikz \fill[shading=_mxyd2nws7,_flphwwo2w] (0,0) rectangle (50bp,50bp); } % Gradient Info \tikzset {_1vv4aec2h/.code = {\pgfsetadditionalshadetransform{ \pgftransformshift{\pgfpoint{0 bp } { 0 bp } } \pgftransformrotate{0 } \pgftransformscale{2 } }}} \pgfdeclarehorizontalshading{_sprp2j4ay}{150bp}{rgb(0bp)=(0.65,0.81,0.87); rgb(37.5bp)=(0.65,0.81,0.87); rgb(62.5bp)=(0.14,0.33,0.54); rgb(100bp)=(0.14,0.33,0.54)} \tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] %uncomment if require: \path (0,386.25); %set diagram left start at 0, and has height of 386.25 %Rounded Rect [id:dp8427758470201833] \draw (388.63,108.07) .. controls (388.63,95.88) and (398.51,86) .. (410.7,86) -- (485.57,86) .. controls (497.75,86) and (507.63,95.88) .. (507.63,108.07) -- (507.63,174.27) .. controls (507.63,186.45) and (497.75,196.33) .. (485.57,196.33) -- (410.7,196.33) .. controls (398.51,196.33) and (388.63,186.45) .. (388.63,174.27) -- cycle ; %Rounded Rect [id:dp3169403847789256] \draw (129.63,181.07) .. controls (129.63,168.88) and (139.51,159) .. (151.7,159) -- (226.57,159) .. controls (238.75,159) and (248.63,168.88) .. (248.63,181.07) -- (248.63,247.27) .. controls (248.63,259.45) and (238.75,269.33) .. (226.57,269.33) -- (151.7,269.33) .. controls (139.51,269.33) and (129.63,259.45) .. (129.63,247.27) -- cycle ; %Shape: Circle [id:dp7450020212232851] \draw [fill={rgb, 255:red, 0; green, 0; blue, 0 } ,fill opacity=1 ] (217,126.32) .. controls (217,121.72) and (220.72,118) .. (225.32,118) .. controls (229.91,118) and (233.63,121.72) .. (233.63,126.32) .. controls (233.63,130.91) and (229.91,134.63) .. (225.32,134.63) .. controls (220.72,134.63) and (217,130.91) .. (217,126.32) -- cycle ; %Shape: Circle [id:dp005827607772636467] \draw [fill={rgb, 255:red, 0; green, 0; blue, 0 } ,fill opacity=1 ] (216,175.32) .. controls (216,170.72) and (219.72,167) .. (224.32,167) .. controls (228.91,167) and (232.63,170.72) .. (232.63,175.32) .. controls (232.63,179.91) and (228.91,183.63) .. (224.32,183.63) .. controls (219.72,183.63) and (216,179.91) .. (216,175.32) -- cycle ; %Shape: Circle [id:dp34524209173568676] \draw [fill={rgb, 255:red, 0; green, 0; blue, 0 } ,fill opacity=1 ] (289.32,143.33) .. controls (289.32,138.74) and (293.04,135.02) .. (297.63,135.02) .. controls (302.23,135.02) and (305.95,138.74) .. (305.95,143.33) .. controls (305.95,147.93) and (302.23,151.65) .. (297.63,151.65) .. controls (293.04,151.65) and (289.32,147.93) .. (289.32,143.33) -- cycle ; %Straight Lines [id:da8271448645768573] \draw (297.63,143.33) -- (385.32,143.33) ; \draw [shift={(387.32,143.33)}, rotate = 180] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ; %Shape: Square [id:dp7469087349202225] \draw [fill={rgb, 255:red, 74; green, 144; blue, 226 } ,fill opacity=0.34 ] (11.32,110.82) -- (31.5,110.82) -- (31.5,131) -- (11.32,131) -- cycle ; %Shape: Square [id:dp2906273668048538] \draw [fill={rgb, 255:red, 155; green, 155; blue, 155 } ,fill opacity=0.56 ] (11.32,131) -- (31.5,131) -- (31.5,151.18) -- (11.32,151.18) -- cycle ; %Shape: Square [id:dp0257238778260086] \draw [fill={rgb, 255:red, 184; green, 233; blue, 134 } ,fill opacity=1 ] (11.32,151.18) -- (31.5,151.18) -- (31.5,171.37) -- (11.32,171.37) -- cycle ; %Shape: Square [id:dp34631290295164263] \draw [fill={rgb, 255:red, 248; green, 231; blue, 28 } ,fill opacity=0.63 ] (11.32,171.37) -- (31.5,171.37) -- (31.5,191.55) -- (11.32,191.55) -- cycle ; %Shape: Square [id:dp7099563053307321] \path [shading=_w5gdki77u,_4c6h9fmv2,path fading= _atyxpg39b ,fading transform={xshift=2}] (11.32,211.73) -- (31.5,211.73) -- (31.5,231.92) -- (11.32,231.92) -- cycle ; % for fading \draw (11.32,211.73) -- (31.5,211.73) -- (31.5,231.92) -- (11.32,231.92) -- cycle ; % for border %Shape: Square [id:dp277447687834944] \path [shading=_sprp2j4ay,_1vv4aec2h] (11.32,231.92) -- (31.5,231.92) -- (31.5,252.1) -- (11.32,252.1) -- cycle ; % for fading \draw (11.32,231.92) -- (31.5,231.92) -- (31.5,252.1) -- (11.32,252.1) -- cycle ; % for border %Shape: Square [id:dp2517468749584255] \draw [fill={rgb, 255:red, 245; green, 166; blue, 35 } ,fill opacity=1 ] (11.32,252.1) -- (31.5,252.1) -- (31.5,272.28) -- (11.32,272.28) -- cycle ; %Shape: Square [id:dp7774821387369513] \draw [fill={rgb, 255:red, 224; green, 16; blue, 203 } ,fill opacity=0.6 ] (11.32,191.55) -- (31.5,191.55) -- (31.5,211.73) -- (11.32,211.73) -- cycle ; % Text Node \draw (448,112) node [scale=1.7280000000000002] [align=left] {{\Large D}}; % Text Node \draw (443.75,170) node [align=left] {Discriminator}; % Text Node \draw (184,203) node [scale=1.7280000000000002] [align=left] {G}; % Text Node \draw (185.75,236) node [align=left] {Generator}; \end{tikzpicture} \end{document}
\documentclass[11pt]{article} \usepackage{tikz} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% %%%> \begin{comment} :Title: Schema of Labs on a class :Tags: Shadows;Styles;Backgrounds;Diagrams :Author: Cristo J. Alanis :Slug: labs-schema Listado de pr\'acticas \end{comment} \usetikzlibrary{shadows,arrows} % Define the layers to draw the diagram \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} % Define block styles \tikzstyle{materia}=[draw, fill=blue!20, text width=6.0em, text centered, minimum height=1.5em,drop shadow] \tikzstyle{practica} = [materia, text width=8em, minimum width=10em, minimum height=3em, rounded corners, drop shadow] \tikzstyle{texto} = [above, text width=6em, text centered] \tikzstyle{linepart} = [draw, thick, color=black!50, -latex', dashed] \tikzstyle{line} = [draw, thick, color=black!50, -latex'] \tikzstyle{ur}=[draw, text centered, minimum height=0.01em] % Define distances for bordering \newcommand{\blockdist}{1.3} \newcommand{\edgedist}{1.5} \newcommand{\practica}[2]{node (p#1) [practica] {Pr\'actica #1\\{\scriptsize\textit{#2}}}} % Draw background \newcommand{\background}[5]{% \begin{pgfonlayer}{background} % Left-top corner of the background rectangle \path (#1.west |- #2.north)+(-0.5,0.5) node (a1) {}; % Right-bottom corner of the background rectanle \path (#3.east |- #4.south)+(+0.5,-0.25) node (a2) {}; % Draw the background \path[fill=yellow!20,rounded corners, draw=black!50, dashed] (a1) rectangle (a2); \path (a1.east |- a1.south)+(0.8,-0.3) node (u1)[texto] {\scriptsize\textit{Unidad #5}}; \end{pgfonlayer}} \newcommand{\transreceptor}[3]{% \path [linepart] (#1.east) -- node [above] {\scriptsize Transreceptor #2} (#3);} \begin{document} \begin{tikzpicture}[scale=0.7,transform shape] % Draw diagram elements \path \practica {1}{Diferencias en componentes electr\'onicos}; \path (p1.south)+(0.0,-1.0) \practica{2}{Serie de Fourier}; \path (p2.south)+(-2.5,-1.5) \practica{3}{Antena para HF}; \path (p3.south)+(0.0,-1.0) \practica{5}{Medidor de SWR}; \path (p3.south)+(5.0,-1.0) \practica{4}{Amplificador para HF}; \path (p4.south)+(-2.5,-1.5) \practica{6}{Oscilador de RF}; \path (p6.south)+(-2.5,-1.25) \practica{7}{Modulador AM}; \path (p6.south)+(2.5,-1.25) \practica{8}{Demodulador AM}; \path (p8.east)+(+5.5,0) node (ur1)[ur] {}; \path (p7.south)+(0.0,-1.5) \practica{9}{Codificador digital}; \path (p8.south)+(0.0,-1.5) \practica{10}{Decodificador digital}; \path (p10.east)+(+5.5,0) node (ur2)[ur] {}; \path (p9.south)+(0.0,-1.5) \practica{11}{Codificador FDM}; \path (p10.south)+(0.0,-1.5) \practica{12}{Decodificador FDM}; \path (p12.east)+(+5.5,0) node (ur3)[ur] {}; \path (p11.south)+(0.0,-1.5) \practica{13}{Codificador SSTV}; \path (p12.south)+(0.0,-1.5) \practica{14}{Decodificador SSTV}; \path (p14.east)+(+5.5,0) node (ur4)[ur] {}; \path (p14.south)+(-2.5,-1.5) \practica{15}{Conmutaci\'on telef\'onica}; \path (p15.south)+(0.0,-1.0) \practica{16}{Telfon\'ia celular an\'aloga}; \path (p16.south)+(0.0,-1.5) \practica{17}{Receptor de telemetr\'ia}; \path (p17.south)+(0.0,-1.5) \practica{18}{Gu\'ias de ondas}; % Draw arrows between elements \path [line] (p1.south) -- node [above] {} (p2); \path [line] (p2.south) -- +(0.0,-0.5) -- +(-2.5,-0.5) -- node [above, midway] {} (p3); \path [line] (p3.south) -- node [above] {} (p5) ; \path [line] (p2.south) -- +(0.0,-0.5) -- +(+2.5,-0.5) -- node [above, midway] {} (p4); \path [linepart] (p3.east) -- +(+0.5,-0.0) -- +(+0.5,-1.75) -- node [left, midway] {} (p4); \path [linepart] (p3.east) -- +(+0.5,-0.0) -- +(+0.5,-1.75) -- node [left, midway] {} (p4); \path [line] (p4.south) -- +(0.0,-0.5) -- +(-2.5,-0.5) -- node [above, midway] {} (p6); \path [line] (p5.south) -- +(0.0,-0.5) -- +(+2.5,-0.5) -- node [above, midway] {} (p6); \path [linepart] (p2.east) -- +(2.75,0.0) -- +(2.75,-5.85) -- node [right] {} (p6); \path [line] (p6.south) -- +(0.0,-0.25) -- +(-2.5,-0.25) -- node [above, midway] {} (p7); \path [line] (p6.south) -- +(0.0,-0.25) -- +(+2.5,-0.25) -- node [above, midway] {} (p8); \path [linepart] (p7.east) -- node [left] {} (p8); \transreceptor{p8}{AM banda 40m}{ur1} \path [line] (p7.south) -- node [above] {} (p9) ; \path [line] (p8.south) -- node [above] {} (p10) ; \path [linepart] (p9.east) -- node [left] {} (p10); \transreceptor{p10}{CW}{ur2} \path [line] (p9.south) -- node [above] {} (p11) ; \path [line] (p10.south) -- node [above] {} (p12) ; \path [linepart] (p11.east) -- node [left] {} (p12); \transreceptor{p12}{FDMDV}{ur3} \path [line] (p11.south) -- node [above] {} (p13) ; \path [line] (p12.south) -- node [above] {} (p14) ; \path [linepart] (p13.east) -- node [left] {} (p14); \transreceptor{p14}{SSTV}{ur4} \path [line] (p14.south) -- +(0.0,-0.5) -- +(-2.5,-0.5) -- node [above, midway] {} (p15); \path [line] (p13.south) -- +(0.0,-0.5) -- +(+2.5,-0.5) -- node [above, midway] {} (p15); \path [line] (p15.south) -- node [above] {} (p16) ; \path [line] (p16.south) -- node [above] {} (p17) ; \path [line] (p17.south) -- node [above] {} (p18) ; \background{p3}{p1}{p4}{p2}{I} \background{p3}{p3}{p4}{p5}{II} \background{p3}{p6}{p4}{p7}{III} \background{p3}{p9}{p4}{p10}{IV} \background{p3}{p11}{p4}{p12}{V} \background{p3}{p13}{p4}{p14}{VI} \background{p3}{p15}{p4}{p16}{VII} \background{p3}{p17}{p4}{p17}{VIII} \background{p3}{p18}{p4}{p18}{IX} \end{tikzpicture} \end{document}
% https://texample.net/tikz/examples/swan-wave-model/ % Author: Marco Miani % SWAN (developed by SWAN group, TU Delft, The Netherlands) is a wave spectral numerical model. %For Simlating WAves Nearshore, it is necessary to define spatial grids of %physical dominant factors (wind friction, dissipation) as well as define a COMPUTATIONAL %grid on which the model performs its (spectral) calculations: budgeting energy spectra over %each cell of the (computational) grid. Grids might have different spatial resolution and extension. \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \pagestyle{empty} % Define the layers to draw the diagram \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \begin{tikzpicture}[scale=.9,every node/.style={minimum size=1cm},on grid] \begin{pgfonlayer}{background} \draw [help lines, step=1,color=blue!15, very thin] (-6, 11) grid (10,-7); \end{pgfonlayer} \begin{pgfonlayer}{foreground} % help guide lines \draw [help lines,dashed] (0,-7) -- (0,11); \draw [help lines,dashed] (-6,0) -- (10,0); \node at (9,10) (zero) {(9,10)}; \node at (6,6) (zero) {(6,6)}; \node at (4,4) (zero) {(4,4)}; \node at (-5,4) (zero) {(-5,4)}; \node at (-5,1) (zero) {(-5,1)}; \node at (-5,-2) (zero) {(-5,-2)}; \node at (-5,-5) (zero) {(-5,-5)}; \node at (7,-5) (zero) {(7,-5)}; \node at (8,-7) (zero) {(8,-7)}; \node at (0,-7) (zero) {(0,-7)}; \end{pgfonlayer} % Comp G %slanting: production of a set of n 'laminae' to be piled up. N=number of grids. \begin{scope}[ yshift=-83,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] % opacity to prevent graphical interference \fill[white,fill opacity=0.9] (0,0) rectangle (5,5); \draw[step=5mm, black] (0,0) grid (5,5); % defining grids \draw[step=1mm, red!50,thin] (3,1) grid (4,2); % Nested Grid \draw[black,very thick] (0,0) rectangle (5,5); % marking borders \fill[red] (0.05,0.05) rectangle (0.5,0.5); % Idem as above, for the n-th grid: % add some labels \begin{scope}[color=blue,font=\footnotesize] \node at (0,0) (a) {(0,0)}; \node at (5,5) (a) {(5,5)}; \node at (5,0) (a) {(5,0)}; \node at (0,5) (a) {(0,5)}; \end{scope} \end{scope} % Bathymetry up \begin{scope}[ yshift=0,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=.9] (0,0) rectangle (5,5); \draw[black,very thick] (0,0) rectangle (5,5); \draw[step=5mm, black] (0,0) grid (5,5); \end{scope} % Wind G % grid with internal 3x3 of step=10mm \begin{scope}[ yshift=90,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=.9] (0,0) rectangle (5,5); \draw[step=10mm, black] (1,1) grid (4,4); \draw[black,very thick] (1,1) rectangle (4,4); \draw[black,dashed] (0,0) rectangle (5,5); \node at (1,1) (a) {(1,1)}; \end{scope} % Friction G % grid with green subgrid of 2mm step \begin{scope}[ yshift=170,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=0.6] (0,0) rectangle (5,5); \draw[step=10mm, black] (2,2) grid (5,5); \draw[step=2mm, green] (2,2) grid (3,3); \draw[black,very thick] (2,2) rectangle (5,5); \draw[black,dashed] (0,0) rectangle (5,5); \node at (2,2) (a) {(2,2)}; \end{scope} % bottom grid \begin{scope}[ yshift=-170,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] %marking border \draw[black,very thick] (0,0) rectangle (5,5); %drawing corners (P1,P2, P3): only 3 points needed to define a plane. \draw [fill=lime](0,0) circle (.1) ; \draw [fill=lime](0,5) circle (.1); \draw [fill=lime](5,0) circle (.1); \draw [fill=lime](5,5) circle (.1); %drawing bathymetric hypotetic countours on the bottom grid: \draw [ultra thick](0,1) parabola bend (2,2) (5,1) ; \draw [dashed] (0,1.5) parabola bend (2.5,2.5) (5,1.5) ; \draw [dashed] (0,2) parabola bend (2.7,2.7) (5,2) ; \draw [dashed] (0,2.5) parabola bend (3.5,3.5) (5,2.5) ; \draw [dashed] (0,3.5) parabola bend (2.75,4.5) (5,3.5); \draw [dashed] (0,4) parabola bend (2.75,4.8) (5,4); \draw [dashed] (0,3) parabola bend (2.75,3.8) (5,3); \draw[-latex,thick](2.8,1) node[right]{$\mathsf{Shoreline}$} to[out=180,in=270] (2,1.99); \end{scope} %end of drawing grids % arrows %putting arrows and labels: \draw[-latex,thick] (6.2,2) node[right]{$\mathsf{Bathymetry (up)}$} to[out=180,in=90] (4,2); \draw[-latex,thick](5.8,-.3)node[right]{$\mathsf{Comp.\ G.}$} to[out=180,in=90] (3.9,-1); \draw[-latex,thick](5.9,5)node[right]{$\mathsf{Wind\ G.}$} to[out=180,in=90] (3.6,5); \draw[-latex,thick](5.9,8.4)node[right]{$\mathsf{Friction\ G.}$} to[out=180,in=90] (3.2,8); \draw[-latex,thick,red](5.3,-4.2)node[right]{$\mathsf{G. Cell}$} to[out=180,in=90] (0,-2.5); \draw[-latex,thick,red](4.3,-1.9)node[right]{$\mathsf{Nested\ G.}$} to[out=180,in=90] (2,-.5); \draw[-latex,thick](4,-6)node[right]{$\mathsf{Batymetry (dn)}$} to[out=180,in=90] (2,-5); \end{tikzpicture} \end{document}
\documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, latexsym} %\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{fadings} \begin{document} \begin{tikzpicture} \node at (0.5,-1){\begin{tabular}{c}input image\\layer $l = 0$\end{tabular}}; \draw (0,0) -- (1,0) -- (1,1) -- (0,1) -- (0,0); \node at (3,3.5){\begin{tabular}{c}convolutional layer\\with non-linearities\\layer $l = 1$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (2.75,1.25) -- (3.75,1.25) -- (3.75,2.25) -- (2.75,2.25) -- (2.75,1.25); \draw[fill=black,opacity=0.2,draw=black] (2.5,1) -- (3.5,1) -- (3.5,2) -- (2.5,2) -- (2.5,1); \draw[fill=black,opacity=0.2,draw=black] (2.25,0.75) -- (3.25,0.75) -- (3.25,1.75) -- (2.25,1.75) -- (2.25,0.75); \draw[fill=black,opacity=0.2,draw=black] (2,0.5) -- (3,0.5) -- (3,1.5) -- (2,1.5) -- (2,0.5); \draw[fill=black,opacity=0.2,draw=black] (1.75,0.25) -- (2.75,0.25) -- (2.75,1.25) -- (1.75,1.25) -- (1.75,0.25); \draw[fill=black,opacity=0.2,draw=black] (1.5,0) -- (2.5,0) -- (2.5,1) -- (1.5,1) -- (1.5,0); \node at (4.5,-1){\begin{tabular}{c}subsampling layer\\layer $l = 3$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (5,1.25) -- (5.75,1.25) -- (5.75,2) -- (5,2) -- (5,1.25); \draw[fill=black,opacity=0.2,draw=black] (4.75,1) -- (5.5,1) -- (5.5,1.75) -- (4.75,1.75) -- (4.75,1); \draw[fill=black,opacity=0.2,draw=black] (4.5,0.75) -- (5.25,0.75) -- (5.25,1.5) -- (4.5,1.5) -- (4.5,0.75); \draw[fill=black,opacity=0.2,draw=black] (4.25,0.5) -- (5,0.5) -- (5,1.25) -- (4.25,1.25) -- (4.25,0.5); \draw[fill=black,opacity=0.2,draw=black] (4,0.25) -- (4.75,0.25) -- (4.75,1) -- (4,1) -- (4,0.25); \draw[fill=black,opacity=0.2,draw=black] (3.75,0) -- (4.5,0) -- (4.5,0.75) -- (3.75,0.75) -- (3.75,0); \node at (7,3.5){\begin{tabular}{c}convolutional layer\\with non-linearities\\layer $l = 4$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (7.5,1.75) -- (8.25,1.75) -- (8.25,2.5) -- (7.5,2.5) -- (7.5,1.75); \draw[fill=black,opacity=0.2,draw=black] (7.25,1.5) -- (8,1.5) -- (8,2.25) -- (7.25,2.25) -- (7.25,1.5); \draw[fill=black,opacity=0.2,draw=black] (7,1.25) -- (7.75,1.25) -- (7.75,2) -- (7,2) -- (7,1.25); \draw[fill=black,opacity=0.2,draw=black] (6.75,1) -- (7.5,1) -- (7.5,1.75) -- (6.75,1.75) -- (6.75,1); \draw[fill=black,opacity=0.2,draw=black] (6.5,0.75) -- (7.25,0.75) -- (7.25,1.5) -- (6.5,1.5) -- (6.5,0.75); \draw[fill=black,opacity=0.2,draw=black] (6.25,0.5) -- (7,0.5) -- (7,1.25) -- (6.25,1.25) -- (6.25,0.5); \draw[fill=black,opacity=0.2,draw=black] (6,0.25) -- (6.75,0.25) -- (6.75,1) -- (6,1) -- (6,0.25); \draw[fill=black,opacity=0.2,draw=black] (5.75,0) -- (6.5,0) -- (6.5,0.75) -- (5.75,0.75) -- (5.75,0); \node at (9.5,-1){\begin{tabular}{c}subsampling layer\\layer $l = 6$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (10,1.75) -- (10.5,1.75) -- (10.5,2.25) -- (10,2.25) -- (10,1.75); \draw[fill=black,opacity=0.2,draw=black] (9.75,1.5) -- (10.25,1.5) -- (10.25,2) -- (9.75,2) -- (9.75,1.5); \draw[fill=black,opacity=0.2,draw=black] (9.5,1.25) -- (10,1.25) -- (10,1.75) -- (9.5,1.75) -- (9.5,1.25); \draw[fill=black,opacity=0.2,draw=black] (9.25,1) -- (9.75,1) -- (9.75,1.5) -- (9.25,1.5) -- (9.25,1); \draw[fill=black,opacity=0.2,draw=black] (9,0.75) -- (9.5,0.75) -- (9.5,1.25) -- (9,1.25) -- (9,0.75); \draw[fill=black,opacity=0.2,draw=black] (8.75,0.5) -- (9.25,0.5) -- (9.25,1) -- (8.75,1) -- (8.75,0.5); \draw[fill=black,opacity=0.2,draw=black] (8.5,0.25) -- (9,0.25) -- (9,0.75) -- (8.5,0.75) -- (8.5,0.25); \draw[fill=black,opacity=0.2,draw=black] (8.25,0) -- (8.75,0) -- (8.75,0.5) -- (8.25,0.5) -- (8.25,0); \node at (12,3.5){\begin{tabular}{c}fully connected layer\\layer $l = 7$\end{tabular}}; \draw[fill=black,draw=black,opacity=0.5] (10.5,0) -- (11,0) -- (12.5,1.75) -- (12,1.75) -- (10.5,0); \node at (13,-1){\begin{tabular}{c}fully connected layer\\output layer $l = 8$\end{tabular}}; \draw[fill=black,draw=black,opacity=0.5] (12.5,0.5) -- (13,0.5) -- (13.65,1.25) -- (13.15,1.25) -- (12.5,0.5); \end{tikzpicture} \end{document}
\documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning, patterns, decorations.pathreplacing} \usetikzlibrary{calc} \usetikzlibrary{arrows,shapes,backgrounds} \begin{document} \begin{tikzpicture}[scale=.9,every node/.style={minimum size=1cm},on grid] \tikzstyle{select arrow}=[->, thick,cyan!70!black] \tikzstyle{action arrow}=[->, thick,cyan!90!black] \tikzstyle{action good}=[thick,cyan!50!black] \tikzstyle{action bad}=[thick,cyan!30] \tikzstyle{active neuron}=[cyan!90] \tikzstyle{selected neuron}=[cyan!30] \tikzstyle{bad action}=[pattern=north west lines, pattern color=cyan!30] %FINAL STATE. plane at the bottom \begin{scope}[ yshift=-160,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=0.9] (0,0) rectangle (2.5,2.5); \draw[step=5mm, black] (0,0) grid (2.5,2.5); \draw[black,very thick] (0,0) rectangle (2.5,2.5); \fill[active neuron] (0.55,0.55) rectangle (0.95,0.95); \draw[->,thick, blue!50!cyan] (0.3,0.25) -- (0.7,0.25); \end{scope} \draw[action arrow, red, thin] (-0.5,-3.25) -- (0,-4.9); %SECOND ACTION \begin{scope}[ yshift=-120,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=.95] (0,0) rectangle (1.5,1.5); \draw[step=5mm, black] (0,0) grid (1.5,1.5); \draw[black,very thick] (0,0) rectangle (1.5,1.5); \fill[bad action] (0.05,0.05) rectangle (0.45,0.45); \fill[bad action] (1.05,0.05) rectangle (1.45,0.45); \fill[bad action] (1.05,1.05) rectangle (1.45,1.45); \fill[bad action] (0.05,1.05) rectangle (0.45,1.45); \node[action good] at (0.25,0.75) {W}; \node[action good] at (1.25,0.75) {E}; \node[action good] at (0.75,1.25) {N}; \node[action bad] at (0.75,0.25) {S}; \end{scope} \draw[action arrow] (0.5,-2.45) -- (0.5,-3.25); \draw[action arrow, red] (0.5,-2.45) -- (-0.5,-3.25); \draw[action arrow] (0.5,-2.45) -- (-0.5,-3.75); %SECOND STATE \begin{scope}[ yshift=-80,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=0.9] (0,0) rectangle (2.5,2.5); \draw[step=5mm, black] (0,0) grid (2.5,2.5); \draw[black,very thick] (0,0) rectangle (2.5,2.5); \fill[active neuron] (0.55,0.05) rectangle (0.95,0.45); \fill[selected neuron] (0.05,0.05) rectangle (0.45,0.45); \fill[selected neuron] (1.05,0.05) rectangle (1.45,0.45); \fill[selected neuron] (0.55,0.55) rectangle (0.95,0.95); \draw[select arrow] (0.85,0.25) -- (1.25,0.25); \draw[select arrow] (0.75,0.35) -- (0.75,.75); \draw[select arrow] (0.65,0.25) -- (0.25,0.25); \end{scope} \draw[action arrow, red] (0.5,-0.45) -- (0.5,-2.3); %FIRST ACTION \begin{scope}[ yshift=-40,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=.95] (0,0) rectangle (1.5,1.5); \draw[step=5mm, black] (0,0) grid (1.5,1.5); \draw[black,very thick] (0,0) rectangle (1.5,1.5); \fill[bad action] (0.05,0.05) rectangle (0.45,0.45); \fill[bad action] (1.05,0.05) rectangle (1.45,0.45); \fill[bad action] (1.05,1.05) rectangle (1.45,1.45); \fill[bad action] (0.05,1.05) rectangle (0.45,1.45); \node[action bad] at (0.25,0.75) {W}; \node[action good] at (1.25,0.75) {E}; \node[action good] at (0.75,1.25) {N}; \node[action bad] at (0.75,0.25) {S}; \end{scope} \draw[action arrow, red] (0.125,0.125) -- (0.5,-0.45); \draw[action arrow] (-0.125,0.125) -- (-0.5,-0.45); %INITIAL STATE. plane at the top \begin{scope}[ every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=0.9] (0,0) rectangle (2.5,2.5); \draw[step=5mm, black] (0,0) grid (2.5,2.5); \draw[black,very thick] (0,0) rectangle (2.5,2.5); \fill[active neuron] (0.05,0.05) rectangle (0.45,0.45); \fill[selected neuron] (0.55,0.05) rectangle (0.95,0.45); \fill[selected neuron] (0.05,0.55) rectangle (0.45,0.95); \draw [decorate,decoration={brace,amplitude=10pt}] (0,2.6) -- (2.6,2.6); \node at (1.6,3.3) {d}; \draw[select arrow] (0.25,0.35) -- (0.25,0.75); \draw[select arrow] (0.35,0.25) -- (0.75,0.25); \node at (1.125,-0.3) {\textbf{x}}; \node at (-0.3,1.125) {\textbf{y}}; \end{scope} \node at (4,1.25) {$S$}; \node at (4,-0.5) {$a$}; \node at (4,-1.5) {$S'$}; \node at (4,-3.25) {$a'$}; \end{tikzpicture} \end{document}
\documentclass[11pt]{article} \usepackage{tikz} \usepackage{tikz-3dplot} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% %%%> \begin{comment} :Title: Seismic focal mechanism in 3D view. :Tags: 3D; Earth Sciences ; Geophysics; Seismology :Author: Cyril Langlois :Source: http://math.et.info.free.fr/TikZ/index.html Adaptation for LaTeX of a figure proposed in P. Shearer's book 'Introduction to Seismology'. It shows the focal sphere with the fault plane and auxiliary plane (which can not be discriminate), limiting compression and dilatation quadrants, the first movement of the rock through the sphere, and the Pression and Tension axis. The figure is based on the sphere drawing's code proposed by J. Dumas in is book `Tikz pour l'impatient <http://math.et.info.free.fr/TikZ/>`_, available online. \end{comment} %%%%%%%%%%% %% helper macros %: Styles for XYZ-Coordinate Systems %: isometric South West : X , South East : Y , North : Z \tikzset{isometricXYZ/.style={x={(-0.866cm,-0.5cm)}, y={(0.866cm,-0.5cm)}, z={(0cm,1cm)}}} %: isometric South West : Z , South East : X , North : Y \tikzset{isometricZXY/.style={x={(0.866cm,-0.5cm)}, y={(0cm,1cm)}, z={(-0.866cm,-0.5cm)}}} %: isometric South West : Y , South East : Z , North : X \tikzset{isometricYZX/.style={x={(0cm,1cm)}, y={(-0.866cm,-0.5cm)}, z={(0.866cm,-0.5cm)}}} %% document-wide tikz options and styles \begin{document} \begin{tikzpicture} [scale=4, isometricZXY, line join=round, opacity=.75, text opacity=1.0,% >=latex, inner sep=0pt,% outer sep=2pt,% ] \def\h{5} \newcommand{\quadrant}[2]{ \foreach \t in {#1} \foreach \f in {175,165,...,5} \draw [fill=#2] ({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)}) -- ({sin(\f - \h)*cos(\t + \h)}, {sin(\f - \h)*sin(\t + \h)}, {cos(\f - \h)}) -- ({sin(\f + \h)*cos(\t + \h)}, {sin(\f + \h)*sin(\t + \h)}, {cos(\f + \h)}) -- ({sin(\f + \h)*cos(\t - \h)}, {sin(\f + \h)*sin(\t - \h)}, {cos(\f + \h)}) -- cycle; } %Quadrants \quadrant{220,230,...,300}{black} \quadrant{-60,-50,...,20}{white} \quadrant{30,40,...,120}{black} \quadrant{130,140,...,210}{none} %Movement arrows \foreach \t in {225,235,...,295} \foreach \f in {50,40,...,0} \draw [red, opacity=1.0, ->, thick] ({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)}) -- ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}); \foreach \t in {125,135,...,205} \foreach \f in {110,100,...,0} \draw [black, ->, thick] ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}) -- ({sin(\f - \h)*cos(\t - \h)},{sin(\f - \h)*sin(\t - \h)},{cos(\f - \h)}); \foreach \t in {35,45,...,115} \foreach \f in {130,120,...,0} \draw [red, opacity=1.0 ,->, thick] ({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)}) -- ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}); \foreach \t in {-55,-45,...,25} \foreach \f in {130,120,...,0} \draw [black, ->, thick] ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}) -- ({sin(\f - \h)*cos(\t - \h)},{sin(\f - \h)*sin(\t - \h)},{cos(\f - \h)}); %Annotations \path ({1.5*sin(100)*cos(75)}, {1.5*sin(100)*sin(75)}, {1.5*cos(100)}) node [right] {Compression}; \path ({1.5*sin(70)*cos(-15)}, {1.5*sin(70)*sin(-15)}, {1.5*cos(70)}) node [right] {Dilatation}; \path ({1.25*sin(50)*cos(165)},{1.25*sin(50)*sin(165)},{1.25*cos(50)}) node [left] {Dilatation}; \path ({1.25*sin(30)*cos(255)},{1.25*sin(30)*sin(255)},{1.25*cos(30)}) node [left] {Compression}; %P and T axis \begin{scope}[ultra thick] \draw[->] ({1.75*sin(90)*cos(75)}, {1.75*sin(90)*sin(75)}, {1.75*cos(90)}) -- ({2*sin(90)*cos(75)},{2*sin(90)*sin(75)},{2*cos(90)}) node [above] {T-axis}; \draw[->] ({1.75*sin(90)*cos(255)},{1.75*sin(90)*sin(255)},{1.75*cos(90)}) -- ({2*sin(90)*cos(255)},{2*sin(90)*sin(255)},{2*cos(90)}) node [below] {T-axis}; \draw[<-] ({1.5*sin(90)*cos(-15)}, {1.5*sin(90)*sin(-15)}, {1.5*cos(90)}) -- ({1.75*sin(90)*cos(-15)},{1.75*sin(90)*sin(-15)},{1.75*cos(90)}) node [right] {P-axis}; \draw[<-] ({1.5*sin(90)*cos(165)}, {1.5*sin(90)*sin(165)}, {1.5*cos(90)}) -- ({1.75*sin(90)*cos(165)},{1.75*sin(90)*sin(165)},{1.75*cos(90)}) node [left] {P-axis}; \end{scope} % Label \node [anchor=north, yshift=-2mm] at (current bounding box.south) {Seismic focal mechanism and Pression-Tension axis.}; \end{tikzpicture} \end{document}
\documentclass[tikz,border=9]{standalone} \usetikzlibrary{mindmap} \usepackage{xspace} \definecolor{joli}{RGB}{225,95,0} \definecolor{JOLI}{RGB}{225,95,0} \newcommand\etoc{\textcolor{joli}{\ttfamily\bfseries etoc}\xspace} \DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\ #1}} \newcount\tikznumberofcurrentgrandchild \def\tikzretangulargroth{% \pgftransformreset \ifnum\tikztreelevel=1 \pgftransformrotate{55+((\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild)}% \pgftransformxshift{\the\tikzleveldistance}% \fi \ifnum\tikztreelevel=2 \pgfmathsetmacro\tikzoffsetofcurrentchild{(\tikzsiblingdistance)*(\tikznumberofcurrentgrandchild)}% \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelwidth pt \pgftransformxshift{\tikzlevelwidth/2-\tikzoffsetofcurrentchild} \pgftransformyshift{\tikzlevelheight/2} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelwidth}% \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight pt \pgftransformxshift{-\tikzlevelwidth/2} \pgftransformyshift{\tikzlevelheight/2-\tikzoffsetofcurrentchild} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelheight}% \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelwidth pt \pgftransformxshift{-\tikzlevelwidth/2+\tikzoffsetofcurrentchild} \pgftransformyshift{-\tikzlevelheight/2} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelwidth}% \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight pt \pgftransformxshift{\tikzlevelwidth/2} \pgftransformyshift{-\tikzlevelheight/2+\tikzoffsetofcurrentchild} \fi\fi\fi\fi \global\advance\tikznumberofcurrentgrandchild by1 \fi } \tikzset{ branch color/.style={ concept color=#1!white, every child/.append style={concept color=#1!white!30!white}, }, level width/.store in=\tikzlevelwidth, level height/.store in=\tikzlevelheight } \begin{document} \tikznumberofcurrentgrandchild=0 \begin{tikzpicture}[ mindmap, growth function=\tikzretangulargroth, nodes={concept}, concept color=orange!60, root concept/.append style={font=\huge, minimum size=5.5cm}, level 1/.append style={level distance=6.5cm, sibling angle=360/8}, level 1 concept/.append style={font=\Large,minimum size=4cm}, level 2/.append style={level width=20cm,level height=28.7cm, sibling distance=2.77cm}, % A4 paper with margin=.5cm ] \node [root concept]{The \etoc package} child [branch color=teal!60]{node {I Overview} child {node {3 Do I need to be a geek to use {\color {joli}\ttfamily \bfseries etoc}\xspace ?}} child {node {4 Line styles and toc display style}} child {node {5 A first example}} child {node {6 A second example}} child {node {7 Linked list of the main package commands}} } child [branch color=yellow!80]{node {II Arbitrarily many TOCs, and local ones too} child {node {8 Labeling and reusing elsewhere}} child {node {9 A powerful functionality of {\color {joli}\ttfamily \bfseries etoc}\xspace : the re-assignment of levels with \csa {etocsetlevel}}} child {node {10 The \csa {etoc\discretionary {-}{}{}set\discretionary {-}{}{}toc\discretionary {-}{}{}depth} and \csa {etoc\discretionary {-}{}{}set\discretionary {-}{}{}next\discretionary {-}{}{}toc\discretionary {-}{}{}depth} commands}} child {node {11 The command \csa {etoc\discretionary {-}{}{}set\discretionary {-}{}{}toc\discretionary {-}{}{}dep\discretionary {-}{}{}th.toc}}} child {node {12 The commands \csa {etoc\discretionary {-}{}{}depth\discretionary {-}{}{}tag.toc} and \csa {etocsettagdepth}}} child {node {13 Adding commands to the \texttt {.toc} file}} child {node {14 Two Examples}} } child [branch color=green!50]{node {III Surprising uses of {\color {joli}\ttfamily \bfseries etoc}\xspace } child {node {15 The TOC of TOCs}} child {node {16 Arbitrary ``Lists Of...'', \csa {etoctoccontentsline}}} child {node {17 A TOC with a fancy layout}} child {node {18 Another compatibility mode}} child {node {19 The TOC as a tree}} child {node {20 The TOC as a molecule}} child {node {21 The TOC as a TikZ Mindmap}} child {node {22 The TOC as a table}} } child [branch color=teal!60]{node {IV Commands for the toc line styles} child {node {23 The \csa {etocsetstyle} command}} child {node {24 The \csa {etocsetlevel} command}} child {node {25 Scope of commands added to the \texttt {.toc} file}} child {node {26 Am I also red?}} } child [branch color=yellow!80]{node {V Commands for the toc display style} child {node {27 Specifying the toc display style}} child {node {28 Starred variants of the \csa {tableofcontents} etc... commands}} child {node {29 Table of contents for this part}} } child [branch color=green!50]{node {VI Using and customizing {\color {joli}\ttfamily \bfseries etoc}\xspace } child {node {30 Summary of the main style commands}} child {node {31 The package default line styles: \csa {etocdefaultlines}}} child {node {32 Customizing {\color {joli}\ttfamily \bfseries etoc}\xspace }} child {node {33 One more example of colored TOC layout}} } child [branch color=teal!60]{node {VII Tips} child {node {34 ... and tricks}} } child [branch color=yellow!80]{node {VIII The code} child {node {35 Timestamp}} child {node {36 Change history}} child {node {37 Implementation}} } ; \end{tikzpicture} \end{document}
\documentclass[]{standalone} \usepackage{tikz} \begin{document} \tikzstyle{scale all}=[every node/.style={scale=#1}, scale=#1] \tikzset{ solution/.pic = { \begin{scope} \draw (0, 0) rectangle ++(1, 1); \draw (0, 1) rectangle ++(1, 1); \draw (0, 2) rectangle ++(1, 1); \draw (0, 3) rectangle ++(1, 1); \node[anchor=center] at (0.5, 0.5) {$m_{123}$}; \node[anchor=center] at (0.5, 1.5) {$\ldots$}; \node[anchor=center] at (0.5, 2.5) {$\ldots$}; \node[anchor=center] at (0.5, 3.5) {$m_1$}; \end{scope}; }, population with number/.pic = { \begin{scope} \draw (0, 0) pic {solution} node at (0.5,-0.75) {1}; \draw (1.5, 0) pic {solution} node at (2,-0.75) {2}; \draw (4.5, 0) pic {solution} node at (5,-0.75) {123}; \draw (3, 2) circle (0.1); \draw (3.5, 2) circle (0.1); \draw (4, 2) circle (0.1); \draw (0.3, 4.3) -- (-0.3, 4.3) -- (-0.3, -0.3) -- (0.3, -0.3); \draw (5.2, 4.3) -- (5.8, 4.3) -- (5.8, -0.3) -- (5.2, -0.3); \end{scope} }, population/.pic = { \begin{scope} \draw (0, 0) pic {solution}; \draw (1.5, 0) pic {solution}; \draw (4.5, 0) pic {solution}; \draw (3, 2) circle (0.1); \draw (3.5, 2) circle (0.1); \draw (4, 2) circle (0.1); \draw (0.3, 4.3) -- (-0.3, 4.3) -- (-0.3, -0.3) -- (0.3, -0.3); % left square bracket \draw (5.2, 4.3) -- (5.8, 4.3) -- (5.8, -0.3) -- (5.2, -0.3); % right square bracket \end{scope} }, population expanded/.pic = { \begin{scope} \draw (0, 0) pic {solution}; \draw (1.5, 0) pic {solution}; \draw[#1] (4.5, 0) pic {solution}; \draw (7.5, 0) pic {solution}; \draw (3, 2) circle (0.1); \draw (3.5, 2) circle (0.1); \draw (4, 2) circle (0.1); \draw (6, 2) circle (0.1); \draw (6.5, 2) circle (0.1); \draw (7, 2) circle (0.1); \draw (0.3, 4.3) -- (-0.3, 4.3) -- (-0.3, -0.3) -- (0.3, -0.3); \draw (8.2, 4.3) -- (8.8, 4.3) -- (8.8, -0.3) -- (8.2, -0.3); \end{scope} }, population sorted/.pic = { \begin{scope} \draw (0, 0) pic {solution} node at (0.5,-0.75) {1}; \draw (1.5, 0) pic {solution} node at (2,-0.75) {2}; \draw (4.5, 0) pic {solution} node at (5,-0.75) {123}; \draw[red] (6, 0) pic {solution} node at (6.5,-0.75) {124}; \draw[red] (9, 0) pic {solution} node at (9.5,-0.75) {123+n}; \draw (3, 2) circle (0.1); \draw (3.5, 2) circle (0.1); \draw (4, 2) circle (0.1); \draw[red] (7.5, 2) circle (0.1); \draw[red] (8, 2) circle (0.1); \draw[red] (8.5, 2) circle (0.1); \draw (0.3, 4.3) -- (-0.3, 4.3) -- (-0.3, -0.3) -- (0.3, -0.3); \draw (10.2, 4.3) -- (10.8, 4.3) -- (10.8, -0.3) -- (10.2, -0.3); \end{scope} }, initial population/.pic = { % Initial population drawing \draw (0, -0.3) node {$\mathbf{P} = $}; \draw (0.75, -1) pic [scale all=0.35] {population with number}; }, augmenting population ten percent/.pic = { % Increasing population by ten percent \draw[<-] (2, 1.5) -- ++(0, 1) node [pos=0.5, anchor=west, blue] {$\mathbf{P} + 10\% $}; \draw (0, 0.425) node {$\mathbf{P} = $}; \draw (0.75, -0.3) pic [scale all=0.35] {population expanded={blue}}; }, pics/gene mutation/.style args ={#1,#2}{ code={ % Mutate a gene with a mutation Mx \begin{scope} \draw (0, 0) rectangle ++(1, 1); \draw (0, 1) rectangle ++(1, 1); \draw[fill={#1}] (0, 2) rectangle ++(1, 1); \draw (0, 3) rectangle ++(1, 1); \draw (0, 4) rectangle ++(1, 1); \node[anchor=center] at (0.5, 0.5) {$m_{123}$}; \node[anchor=center] at (0.5, 1.5) {$\ldots$}; \node[anchor=center] at (0.5, 2.5) {{#2}}; \node[anchor=center] at (0.5, 3.5) {$\ldots$}; \node[anchor=center] at (0.5, 4.5) {$m_1$}; \end{scope}; } }, mutate a gene/.pic = { \draw[->] (-1, 3.725) -- ++(0, -1.25) -- ++(0.75, 0) node [pos=0.25, scale=0.75, anchor=north, yshift=-2] {cloning}; \draw (0, 1.575) pic [scale all=0.35] {gene mutation={yellow,$m_k$}}; \draw[->] (0.75, 2.5) -- ++(1, 0) node [yshift=-2, scale=0.75, pos=0.5, anchor=north] {$\textbf{Mx}(m_k)$}; \draw[fill=green] (2, 2.325) rectangle ++(0.35, 0.35); \node[anchor=center, scale=0.35] at (2.175, 2.495) {$m_{k}'$}; \draw[->] (2.75, 2.5) -- ++(1, 0) node[pos=0.5, yshift=-2, scale=0.75, anchor=north] {mutation}; \draw (4, 1.575) pic [scale all=0.35] {gene mutation={green, $m_k'$}}; \draw[->] (4.175, 3.5) -- ++(0, 1.2) -- ++(-3.5, 0) node[pos=0.5, scale=0.75, anchor=north] {insertion}; }, pics/cluster population/.style args = {#1}{ code = { \draw (0, 0) pic [scale all=0.35] {population}; \draw (0.85, 2) node {{#1}}; } }, clusters populations/.pic = { \draw (0, 0) pic {cluster population={$\mathbf{P}_{G(s) = 0}$}}; \draw[dashed] (2.225, -0.5) -- ++(0, 2.5) node [pos=0, anchor=north] {$ < 123$}; \draw (2.5, 0) pic {cluster population={$\mathbf{P}_{G(s) = 1}$}}; \draw[dashed] (4.725, -0.5) -- ++(0, 2.5) node [pos=0, anchor=north] {$ < 123$}; \draw (5, 0) pic {cluster population={$\mathbf{P}_{G(s) = 2}$}}; \draw (7.225, -0.5) -- ++(0, 2.5) node [pos=0, anchor=north] {$\geq 123$}; \draw (7.5, 0) pic[red] {cluster population={$\mathbf{P}_{G(s) = 3}$}}; \draw[red] (9.725, -0.5) -- ++(0, 2.5) node [pos=0, anchor=north] {$> 123$}; \draw (-0.25, -1) -- (-0.25, -1.3) -- (7.225, -1.3) -- (7.225, -1); }, sorting cost/.pic = { \draw (0, 0) pic[scale all=0.35] {population sorted}; \draw (0, -0.5) node [anchor=center, scale=0.75] {$\min\,C(s)$}; \draw (3.8, -0.5) node [anchor=center, scale=0.75] {$\max\,C(s)$}; } } \begin{tikzpicture} \draw (0, 0) pic {initial population}; \draw (0, -4) pic {augmenting population ten percent}; \draw (3.5, -8.25) pic {mutate a gene}; \draw[<-] (2, -8) -- ++(0, 1) node [pos=0.5, anchor=west, blue] {$\mathbf{P} + 50\% $}; \draw (0, -10.5) pic {clusters populations}; \draw[<-] (2, -12.80) -- ++(0, 1) node [pos=0.5, anchor=west, blue] {Gap-based selection}; \draw (0, -14.5) pic {sorting cost}; \draw[->] (2, -15.3) -- ++(0, -1) node [pos=0.5, anchor=west, blue] {Cost-based selection} -- ++(-3, 0) -- (-1, -0.25) -- ++(0.5, 0); %\draw (0, -17) pic {initial population}; % Indication lateral \draw (10, 1) -- ++(0.5, 0) -- node [rotate=90, pos=0.5, anchor=north] {(1) Random augmentation} ++(0, -3.5) -- ++(-0.5, 0); \draw (10, -2.7) -- ++(0.5, 0) -- node [rotate=90, pos=0.5, anchor=north] {(2) Cloning and Mutate} ++(0, -5.25) -- ++(-0.5, 0); \draw (10, -8.1) -- ++(0.5, 0) -- node [rotate=90, pos=0.5, anchor=north] {(3) Gap Sorting/Selection} ++(0, -4.5) -- ++(-0.5, 0); \draw (10, -12.8) -- ++(0.5, 0) -- node [rotate=90, pos=0.5, anchor=north] {(4) Cost Sorting/Selection} ++(0, -3.5) -- ++(-0.5, 0); \end{tikzpicture} \end{document}
% (S) -> (M) -> (V) -> (shuffle) -> (P) -> (R) - (F) % S for Start F for Final \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{% calc, fit, shapes, backgrounds } % the next macro is useful to create a table \newcommand\tabins[3]{% \tikz[baseline=(Tab.base)] \node [rectangle split, rectangle split parts=3, draw, align=right, inner sep=.5em, rectangle split horizontal] (Tab) {\hbox to 4ex{#1} \nodepart{two} {\hbox to 8ex{\hfill #2\$}} \nodepart{three}{\hbox to 3ex{#3}}}; } \begin{document} \parindent=0pt \begin{tikzpicture}[% %every node/.style={transform shape},% now it's not necessary but good for a poster x=1.25cm,y=2cm, font=\footnotesize, % every group of nodes have a style except for main, the style is named by a letter main/.style={draw,fill=yellow,inner sep=.5em}, R/.style={draw,fill=purple!40!blue!30,inner sep=.5em}, M/.style={draw,fill=green!80!yellow,inner sep=.5em}, S/.style={anchor=east}, V/.style={anchor=west}, P/.style={anchor=center}, F/.style={anchor=west} ] % main node the reference Shuffle \node[main] (shuffle) {Group}; %group R reducer \node[R] at ($(shuffle)+(8,1)$) (R1+) {Reduce}; \node[R] at ($(shuffle)+(8, 0)$) (R0) {Reduce}; \node[R] at ($(shuffle)+(8,-1)$) (R1-) {Reduce}; % group M Mapper \node[M] at ($(shuffle)+(-6,+2.5)$) (M3+) {Map}; \node[M] at ($(shuffle)+(-6,+ 1.5)$) (M2+) {Map}; \node[M] at ($(shuffle)+(-6,+ .5)$) (M1+) {Map}; \node[M] at ($(shuffle)+(-6,- .5)$) (M1-) {Map}; \node[M] at ($(shuffle)+(-6,- 1.5)$) (M2-) {Map}; \node[M] at ($(shuffle)+(-6,-2.5)$) (M3-) {Map}; % group S Start the first nodes \node[S] at ($(M3+)+(-1.5,0)$) (S3+) {\Big($k_1$,\tabins{4711}{59.90}{NY}\Big)}; \node[S] at ($(M2+)+(-1.5,0)$) (S2+) {\Big($k_2$,\tabins{4713}{142.99}{CA}\Big)}; \node[S] at ($(M1+)+(-1.5,0)$) (S1+) {\Big($k_3$,\tabins{4714}{72.00}{NY}\Big)}; \node[S] at ($(M1-)+(-1.5,0)$) (S1-) {\Big($k_4$,\tabins{4715}{108.75}{NY}\Big)}; \node[S] at ($(M2-)+(-1.5,0)$) (S2-) {\Big($k_5$,\tabins{4718}{19.89}{WA}\Big)}; \node[S] at ($(M3-)+(-1.5,0)$) (S3-) {\Big($k_6$,\tabins{4719}{36.60}{CA}\Big)}; % group V why not \node[V] at ($(M3+)+(1.5,0)$) (V3+) {\Big(NY,59.90\$\Big)}; \node[V] at ($(M2+)+(1.5,0)$) (V2+) {\Big(CA,142.99\$\Big)}; \node[V] at ($(M1+)+(1.5,0)$) (V1+) {\Big(NY,72.00\$\Big)}; \node[V] at ($(M1-)+(1.5,0)$) (V1-) {\Big(NY,108.75\$\Big)}; \node[V] at ($(M2-)+(1.5,0)$) (V2-) {\Big(WA,19.89\$\Big)}; \node[V] at ($(M3-)+(1.5,0)$) (V3-) {\Big(CA,36.60\$\Big)}; \node[P] at ($(R1+)+(-4,0)$) (P1+) {\Big(CA,\big[142.99\$,36.60\$\big]\Big)}; \node[P] at ($(R0) +(-4,0)$) (P0) {\Big(NY,\big[59.90\$,72.00\$,108.75\big]\Big)}; \node[P] at ($(R1-)+(-4,0)$) (P1-) {\Big(WA,\big[19.89\$\big]\Big)}; \node[F] (F1+) at ($(R1+)+(1.5,0)$) {(CA,89.80\$)}; \node[F] (F0) at ($(R0) +(1.5,0)$) {(NY,80.22\$)}; \node[F] (F1-) at ($(R1-)+(1.5,0)$) {(WA,72.00\$)}; % wrappers \begin{scope}[on background layer] \node[fill=lightgray!50,inner sep = 4mm,fit=(shuffle),label=above:Shuffle] {}; \end{scope} \begin{scope}[on background layer] \node[fill=lightgray!50,inner sep = 4mm,fit=(R1+)(R1-),label=above:Reducer] {}; \end{scope} \begin{scope}[on background layer] \node[fill=lightgray!50,inner sep = 4mm,fit=(M3+)(M3-),label=above:Mapper] {}; \end{scope} %edges \foreach \indice in {3+,2+,1+,1-,2-,3-} \draw[->] (S\indice.east) -- (M\indice.west); \foreach \indice in {3+,2+,1+,1-,2-,3-} \draw[->] (M\indice.east) -- (V\indice.west); \foreach \indice in {3+,2+,1+,1-,2-,3-} \draw[->] (V\indice.east) to [out=0,in=180] (shuffle.west); \foreach \indice in {1+,0,1-} \draw[->] (shuffle.east) to [out=0,in=180] (P\indice.west); \foreach \indice in {1+,0,1-} \draw[->] (P\indice.east) -- (R\indice.west); \foreach \indice in {1+,0,1-} \draw[->] (R\indice.east) -- (F\indice.west); \end{tikzpicture} \end{document}
\documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{amsmath} \usepackage{tikz-3dplot} \pgfplotsset{compat=1.14} \tikzset{>=latex} \begin{document} % !TEX root = ../main.tex \tdplotsetmaincoords{60}{100} \begin{tikzpicture}[scale=1.5,tdplot_main_coords] % DEFINITIONS % figOmegaRotation : Value for the Omega angle \pgfmathsetmacro{\figOmega}{33} % figIRotation : value for inclination of the orbital plane \pgfmathsetmacro{\figIRotation}{30} % \figAEll : minimum value for ellipse \pgfmathsetmacro{\figAEll}{2.5} % \figBEll : minimum value for ellipse \pgfmathsetmacro{\figBEll}{3} % figYOrigin : focus of the ellipse with 2.5 and 3 \pgfmathsetmacro{\figYOrigin}{sqrt(\figBEll^2 - \figAEll^2)} % sqrt(b^2 - a^2) % COMMANDS % \positionOnEl{\storing}{\quadrant}{\x} % Saves into \storing the position \y on the ellipse % specified by \figAEll and \figBEll. \quadrant should help % in defining the quadrant (must be +1 or -1) \newcommand{\positionXOnEl}[3]{% \pgfmathsetmacro{#1}% {\figYOrigin+#2*% \figBEll*((1-#3^2/\figAEll^2)^2)^(0.25)}} \newcommand{\positionYOnEl}[3]{% \pgfmathsetmacro{#1}% {#2*((\figBEll^2-\figYOrigin^2+2*\figYOrigin*#3-#3^2)^2)^(0.25)*(\figAEll/\figBEll)}} \positionYOnEl{\ellPositY}{-1}{\figBEll} \positionYOnEl{\ellPositYY}{1}{0} \pgfmathsetmacro{\xstartV}{cos(atan(\figBEll/\ellPositY))*0.5} \pgfmathsetmacro{\ystartV}{sin(atan(\figBEll/\ellPositY))*0.5} % Origin Position for the drawing \coordinate (O) at (0, 0, 0); % REFERENCE FRAME % x axis \draw[tdplot_main_coords, very thin] (-4.5, 0, 0) -- (-0.5, 0, 0); % y axis \draw[tdplot_main_coords, very thin] (0, -2.1, 0) -- (0, -0.5, 0); \draw[tdplot_main_coords, ->, very thin] (0, 0.5, 0) -- (0, 5, 0) node [anchor=west] {$y$}; % EQUATORIAL PLANE \draw[tdplot_main_coords, very thin,gray] (4, 4.7, 0) -- (4, -2, 0) -- node[anchor=south, rotate=54] {\footnotesize equatorial plane} (-4,-2, 0) -- (-4, 4.7, 0) -- (4, 4.7, 0); % Equatorial plane Ellipses \draw[tdplot_main_coords, very thin, dashed, gray!50] (0, \figYOrigin, 0) ellipse ({\figAEll} and {\figBEll}); % Rotazione sulla linea dei nodi \tdplotsetrotatedcoords{0}{0}{\figOmega} % Ellipses in equatorial plane \draw[tdplot_rotated_coords, fill, color=gray!40, opacity=0.1] (0, \figYOrigin, 0) ellipse ({\figAEll} and {\figBEll}); \draw[tdplot_rotated_coords, very thin, dashed] (0, \figYOrigin, 0) ellipse ({\figAEll} and {\figBEll}); % reference on rotated ellipse \draw[tdplot_rotated_coords, very thin] (0, -2.1, 0) -- (0, -0.5, 0); \draw[tdplot_rotated_coords, ->, very thin] (0, 0.5, 0) -- (0, 5, 0) node [anchor=west] {$y'$}; \shade[tdplot_rotated_coords, ball color = green!40, opacity = 0.8] (0, 0, 0) circle (0.5cm); % Rotation on ascension \tdplotsetrotatedcoords{90+\figOmega}{-\figIRotation}{-90} % Orbit ellipse \draw[tdplot_rotated_coords, fill, color=gray!40, opacity=0.3] (0, \figYOrigin, 0) ellipse ({\figAEll} and {\figBEll}); \draw[tdplot_rotated_coords, very thin] (0, \figYOrigin, 0) ellipse ({\figAEll} and {\figBEll}); % Part of trajectory \draw[tdplot_rotated_coords, very thick] (\ellPositYY, 0, 0) arc (-33.5:154:{\figAEll} and {\figBEll}); % Line of Nodes \draw[tdplot_rotated_coords] (0.5, 0, 0) -- (4, 0, 0) node [anchor=north west,fill=white] {\footnotesize line of nodes}; % Line of apsis \draw[tdplot_rotated_coords, ->, very thin] (0, 0.5, 0) -- (0, 5, 0) node[anchor=south west] {\footnotesize line of apsis}; % V vector (solved through ellipse equation) \draw[tdplot_rotated_coords,->,thick] (-\xstartV, -\ystartV, 0) -- (\ellPositY, \figBEll, 0); \shade[tdplot_rotated_coords,ball color = green] (\ellPositY, \figBEll, 0) circle (0.05cm) node[anchor=south east, color=green!40!black!50] {\footnotesize debris}; % Planet % Equatorial circle in \draw[tdplot_rotated_coords, very thin] (0, 0, 0) circle (0.5); \draw[tdplot_main_coords, very thin, gray] (0, 0, 0) circle (0.5); % x axis in original reference frame % redesegn for z-buffer \draw[tdplot_main_coords, ->, very thin] (0.75, 0, 0) -- (4.5, 0, 0) node [anchor=north] {$x$}; % z axis \draw[tdplot_main_coords, ->, very thin] (0, 0, 0.5) -- (0, 0, 2) node[anchor=south] {$z$}; % OMEGA \tdplotdrawarc[tdplot_main_coords, color=red, ->] {(0,0,0)}{2.5}{0}{\figOmega}{anchor=north}{$\Omega$} % omega \tdplotdrawarc[tdplot_rotated_coords, color=red, ->] {(0,0,0)}{1.8}{0}{90}{anchor=west}{$\omega$} \tdplotdrawarc[tdplot_rotated_coords, color=red, ->] {(0,0,0)}{1.8}{90}{126.8}{anchor=south}{$v$} % n vector \draw[tdplot_rotated_coords, ->, color=red, pos=0.8] (0.5, 0, 0) -- node [anchor=north east, pos=0.6] {$n$} (\ellPositYY, 0, 0); \draw[tdplot_rotated_coords, ->, color=red] (0, 0.5, 0) -- node [anchor=south east, pos=0.85] {$e$} (0, 3 + \figYOrigin, 0); % piano per i \shade[tdplot_rotated_coords,ball color = blue] (0, \figYOrigin + \figBEll, 0) circle (0.05cm) node[anchor=west, color=blue] {\footnotesize apoapsis}; \shade[tdplot_rotated_coords,ball color = red] (\ellPositYY, 0, 0) circle (0.05cm) node[anchor=west, color=red] {\footnotesize ascending node}; \draw[tdplot_rotated_coords] (0,0,0) circle (0.5); \tdplotsetrotatedcoords{\figOmega}{90}{0} % i angle \tdplotdrawarc[tdplot_rotated_coords, color=red, ->] {(0, 0, 0)}{\figYOrigin+\figBEll}{90}{118}{anchor=west}{$i$} % Orbital Plane Label \node[tdplot_main_coords,rotate=33.5,anchor=east,color=gray] at (-4.8,-0.3,0) {\footnotesize orbital plane}; % Planet \end{tikzpicture} \end{document}
\documentclass[tikz,border=10pt]{standalone} %%%< \usepackage{verbatim} %%%> \begin{comment} :Title: Poincare Diagram, Classification of Phase Portraits :Features: :Tags: Arcs;Foreach;Markings;Diagrams;Plots;Mathematics :Author: Gernot Salzer :Slug: poincare The solutions of a system of linear differential equations can be classified according to the trace and the determinant of the coefficient matrix. This diagram show schematically the different types of solutions. Originally published on TeX.SX, tex.stackexchange.com/a/347401, 6 Jan 2017 Based on a manual drawing by Douglas R. Hundley, http://people.whitman.edu/~hundledr/courses/M244/Poincare.pdf You may use the code without any restrictions; no rights reserved. \end{comment} \usetikzlibrary{decorations.markings} \tikzset {every pin/.style = {pin edge = {<-}}, % pins are arrows from label to point > = stealth, % arrow tips look like stealth bombers flow/.style = % everything marked as "flow" will be decorated with an arrow {decoration = {markings, mark=at position #1 with {\arrow{>}}}, postaction = {decorate} }, flow/.default = 0.5, % default position of the arrow is in the middle main/.style = {line width=1pt} % thick lines for main graph } % \newtemplate[Scaling, default 0.18]{\NameOfTemplate}{Caption}{Code} % % Typesets Code and stores it in the box \NameOfTemplate. % This way we avoid nested tikzpictures when inserting the templates into the % main picture, since nesting is not guaranteed to work. \newcommand\newtemplate[4][0.18]% {\newsavebox#2% \savebox#2% {\begin{tabular}{@{}c@{}} \begin{tikzpicture}[scale=#1] #4 \end{tikzpicture}\\[-1ex] \templatecaption{#3}\\[-1ex] \end{tabular}% }% } \newcommand\template[1]{\usebox{#1}} % use the Code stored in box #1 \newcommand\templatecaption[1]{{\sffamily\scriptsize#1}} % typeset caption \newcommand\Tr{\mathop{\mathrm{Tr}}} \newtemplate\sink{sink}% {\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (\sx4,0) -- (0,0); % draw half of horizontal axis \draw[flow] (0,\sx4) -- (0,0); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b in {2/1,3/0.44} % draw two half-parabolas \draw[flow,domain=\sx\a:0] plot (\x, {\sy\b*\x*\x}); } } \newtemplate\source{source}% {\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (0,0) -- (\sx4,0); % draw half of horizontal axis \draw[flow] (0,0) -- (0,\sx4); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b in {2/1,3/0.44} % draw two half-parabolas \draw[flow,domain=0:\sx\a] plot (\x, {\sy\b*\x*\x}); } } \newtemplate\stablefp{line of stable fixed points}% {\draw (-4,0) -- (4,0); % draw horizontal axis \foreach \sy in {+,-} % for upper/lower half do: {\draw[flow] (0,\sy4) -- (0,0); % draw half of vertical axis \foreach \x in {-3,-2,-1,1,2,3} % draw six vertical half-lines \draw[flow] (\x,\sy3) -- (\x,0); } } \newtemplate\unstablefp{line of unstable fixed points}% {\draw (-4,0) -- (4,0); % draw horizontal axis \foreach \sy in {+,-} % for upper/lower half do: {\draw[flow] (0,0) -- (0,\sy4); % draw half of vertical axis \foreach \x in {-3,-2,-1,1,2,3} % draw six vertical half-lines \draw[flow] (\x,0) -- (\x,\sy3); } } \newtemplate\spiralsink{spiral sink}% {\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \draw [samples=100,smooth,domain=27:7] % draw spiral plot ({\x r}:{0.005*\x*\x}); % Using "flow" here gives "Dimension \def\x{26} % too large", so we draw a tiny \draw[->] ({\x r}:{0.005*\x*\x}) -- +(0.01,-0.01);% tangent for the arrow. } \newtemplate\spiralsource{spiral source}% {\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \draw [samples=100,smooth,domain=10:28] % draw spiral plot ({-\x r}:{0.005*\x*\x}); % Using "flow" here gives "Dimension \def\x{27.5} % too large", so we draw a tiny \draw[<-] ({-\x r}:{0.005*\x*\x}) -- +(0.01,-0.008);% tangent for the arrow. } \newtemplate[0.15]\centre{center}% British spelling since \center is in use {\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \foreach \r in {1,2,3} % draw three circles \draw[flow=0.63] (\r,0) arc (0:-360:\r cm); } \newtemplate\saddle{saddle}% {\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (\sx4,0) -- (0,0); % draw half of horizontal axis \draw[flow] (0,0) -- (0,\sx4); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b/\c/\d in {2.8/0.3/0.7/0.6, 3.9/0.4/1.3/1.1} \draw[flow] (\sx\a,\sy\b) % draw two bent lines .. controls (\sx\c,\sy\d) and (\sx\d,\sy\c) .. (\sx\b,\sy\a); } } \newtemplate\degensink{degenerate sink}% {\draw (0,-4) -- (0,4); % draw vertical axis \foreach \s in {+,-} % for upper/lower half do: {\draw[flow] (\s4,0) -- (0,0); % draw half of horizontal axis \foreach \a/\b/\c/\d in {3.5/4/1.5/1, 2.5/2/1/0.8} \draw[flow] (\s-3.5,\s\a) % draw two bent lines .. controls (\s\b,\s\c) and (\s\b,\s\d) .. (0,0); } } \newtemplate\degensource{degenerate source}% {\draw (0,-4) -- (0,4); % draw vertical axis \foreach \s in {+,-} % for upper/lower half do: {\draw[flow] (0,0) -- (\s4,0); % draw half of horizontal axis \foreach \a/\b/\c/\d in {3.5/4/1.5/1, 2.5/2/1/0.8} \draw[flow] (0,0) % draw two bent lines .. controls (\s\b,\s\d) and (\s\b,\s\c) .. (\s-3.5,\s\a); } } \begin{document} \begin{tikzpicture}[line cap=round,line join=round] % MAIN DIAGRAM \draw [main,->] (0,-0.3) -- (0,4.7) % vertical axis node [label={[above]$\scriptstyle\det A$}] {} node [label={[above,yshift=0.8cm]% {\sffamily\large Poincar\'e Diagram: Classification of Phase Portraits in the $(\det A,\Tr A)$-plane}}] {}; \draw [main,->] (-5,0) -- (5,0) % horizontal axis node [label={[right,yshift=-0.5ex]$\scriptstyle\Tr A$}] {}; \draw [main, domain=-4:4] plot (\x, {0.25*\x*\x}); % main graph \node at (-4,4) [pin={[above]$\scriptstyle\Delta=0$}] {}; \node at ( 4,4) [pin={[above,align=left]% {$\scriptstyle\Delta=0:\;\det A=\frac{1}{4}(\Tr A)^2$}}] {}; % TEMPLATES describing areas \node at ( 0 ,-1.4) {\template\saddle}; \node at (-4 , 1 ) {\template\sink}; \node at ( 4 , 1 ) {\template\source}; \node at (-1.8, 3.7) {\template\spiralsink}; \node at ( 1.8, 3.7) {\template\spiralsource}; % TEMPLATES labeling lines and points \node at ( 0 , 1.2) [pin={[draw,right,xshift=0.3cm]% \template\centre}] {}; \node at (-3 , 0 ) [pin={[draw,below,yshift=-1cm]% \template\stablefp}] {}; \node at ( 3 , 0 ) [pin={[draw,below,yshift=-1cm]% \template\unstablefp}] {}; \node at (-3.5,{0.25*3.5*3.5}) [pin={[draw,left,xshift=-1.15cm,yshift=-0.3cm]% \template\degensink}] {}; \node at ( 3.5,{0.25*3.5*3.5}) [pin={[draw,right,xshift=0.9cm,yshift=-0.3cm]% \template\degensource}] {}; \node at ( 0 , 0 ) [pin={[draw,above left,align=center,xshift=-0.3cm]% \templatecaption{uniform}\\[-1ex]\templatecaption{motion}}] {}; \end{tikzpicture} \end{document}
\documentclass[border=5pt]{standalone} \usepackage{xcolor} \usepackage{ulem} \definecolor{ocre}{HTML}{800000} \definecolor{sky}{HTML}{C6D9F1} \definecolor{skybox}{HTML}{5F86B3} \usepackage{tikz} \usepackage{pgfmath} \usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings} \renewcommand*\familydefault{\sfdefault} % Set font to serif family % arctext from Andrew code with modifications: %Variables: 1: ID, 2:Style 3:box height 4: Radious 5:start-angl 6:end-angl 7:text {format along path} \def\arctext[#1][#2][#3](#4)(#5)(#6)#7{ \draw[#2] (#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3) -- (#6:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1) arc (#6:#5:#4cm-#3) coordinate (below #1) -- (#5:#4) coordinate (left #1) -- cycle; \def\a#1{#4cm+#3} \def\b#1{#4cm-#3} \path[ decoration={ raise = -0.5ex, % Controls relavite text height position. text along path, text = {#7}, text align = center, }, decorate ] (#5:#4) arc (#5:#6:#4); } % arcarrow, this is mine, for beerware purpose... % Function: Draw an arrow from arctex coordinate specific nodes to another % Arrow start at the start of arctext box and could be shifted to change the position % to avoid go over another box. % Var: 1:Start coordinate 2:End coordinate 3:angle to shift from acrtext box \def\arcarrow(#1)(#2)[#3]{ \draw[very thick,->,>=latex,black!60] let \p1 = (#1), \p2 = (#2), % To access cartesian coordinates x, and y. \n1 = {veclen(\x1,\y1)}, % Distance from the origin \n2 = {veclen(\x2,\y2)}, % Distance from the origin \n3 = {atan2(\y1,\x1)} % Angle where acrtext starts. in (\n3-#3: \n1) -- (\n3-#3: \n2); % Draw the arrow. } \begin{document} \begin{tikzpicture}[ % Environment Cfg font=\sf \scriptsize, % Styles myarrow/.style={ very thick, -latex, black!60, }, Center/.style ={ circle, fill=ocre, text=white, align=center, font =\footnotesize\bf, inner sep=1pt, }, RedArc/.style ={ color=black, thick, fill=ocre, blur shadow, }, SkyArc/.style ={ color=skybox, thick, fill=sky, blur shadow, }, ] % Drawing the center for AI \node[Center](AI) at (0,0) { Artificial \\ Intelligence \\(AI)\\ Agent}; \coordinate (AROUND) at (0:1.2); % Drawing the Text Arcs % Format: \Arctext[ID][box-style][box-height](radious)(start-angl)(end-angl){|text-styles| Text} % Machine Learning \arctext[ML][RedArc][8pt](2.75)(140)(75){|\footnotesize\bf\color{white}| Machine Learning}; \arctext[REIN][SkyArc][5pt](3.50)(140)(75){|\scriptsize\color{black}| Reinforcement Learning}; \arctext[KNOW][SkyArc][5pt](4.00)(110)(75){|\scriptsize| Knowledge L.}; \arctext[SUPL][SkyArc][5pt](4.00)(140)(112){|\scriptsize| Supervised L.}; \arctext[PROB][SkyArc][5pt](4.50)(140)(109){|\scriptsize\color{black}| Probabilistic Models}; \arctext[PROB][SkyArc][5pt](4.50)(107)(75){|\scriptsize\color{black}| Unsupervised L.}; % Problem Solving \arctext[SOLV][RedArc][8pt](2.75)(70)(23){|\footnotesize\bf\color{white}| Problem Solving}; \arctext[SRCH][SkyArc][5pt](3.50)(70)(23){|\scriptsize\color{black}| Search }; \arctext[HEUR][SkyArc][5pt](4.00)(70)(50){|\scriptsize| Heuristics}; \arctext[ADVS][SkyArc][5pt](4.00)(47)(23){|\scriptsize| Adversarial S.}; \arctext[CONST][SkyArc][5pt](4.50)(70)(23){|\scriptsize\color{black}| Constraint Analysis }; % Natural Language Processing \arctext[NLP][RedArc][8pt](2.75)(20)(-17){|\footnotesize\bf\color{white}| NLP}; \arctext[TRAN][SkyArc][5pt](3.50)(20)(-20){|\scriptsize\color{black}| Machine translation}; \arctext[SPER][SkyArc][5pt](4.00)(20)(-20){|\scriptsize| Speech Recognition}; \arctext[INFX][SkyArc][5pt](4.50)(20)(-20){|\scriptsize\color{black}| Information Extraction}; % Decision Making \arctext[DEC][RedArc][8pt](2.75)(293)(340){|\footnotesize\bf\color{white}| Decision Making}; \arctext[LOG][SkyArc][5pt](3.50)(293)(335){|\scriptsize\color{black}| Logic}; \arctext[KNOW][SkyArc][5pt](4.00)(293)(335){|\scriptsize| Knowledge Engineering}; \arctext[PLAN][SkyArc][5pt](4.50)(293)(335){|\scriptsize| Real World Planning}; % Reasoning \arctext[REAS][RedArc][8pt](2.75)(247)(291){|\footnotesize\bf\color{white} | Reasoning}; \arctext[PROB][SkyArc][5pt](3.50)(247)(291){|\scriptsize\color{black}| Probabilistic R.}; \arctext[REAT][SkyArc][5pt](4.00)(247)(271){|\scriptsize| Bayesian Nets}; \arctext[REAT][SkyArc][5pt](4.00)(272)(291){|\scriptsize| R.over time}; \arctext[UNQU][SkyArc][5pt](4.50)(247)(291){|\scriptsize\color{black}| Uncertainty Quantification}; % Robotics \arctext[ROB][RedArc][8pt](2.75)(210)(245){|\footnotesize\bf\color{white}| Robotics}; \arctext[RPER][SkyArc][5pt](3.50)(210)(245){|\scriptsize\color{black}| R. Perception}; \arctext[RACT][SkyArc][5pt](4.00)(210)(245){|\scriptsize| R. Actuation}; \arctext[MAPL][SkyArc][5pt](4.50)(210)(245){|\scriptsize\color{black}| Mapping, Localization}; % Object Recognition \arctext[RECO][RedArc][8pt](2.75)(145)(206){|\footnotesize\bf\color{white}| Object Recognition}; \arctext[VIS][SkyArc][5pt](3.50)(145)(206){|\scriptsize\color{black}| Vision}; \arctext[IMGP][SkyArc][5pt](4.00)(145)(175){|\scriptsize\color{black}| Image Processing }; \arctext[IMGP][SkyArc][5pt](4.00)(176)(206){|\scriptsize\color{black}| 3D Reconstruction }; \arctext[MOTC][SkyArc][5pt](4.50)(145)(206){|\scriptsize\color{black}| Motion, shading, contour analysis}; % %ADITIONAL EXTERNAL ARC % \arctext[NEW][ % color=white, % shade, % upper left=gray, % upper right=black!50, % lower left=gray, % lower right=gray!50, % rounded corners = 8pt % ][8pt](5.2)(180)(0){|\footnotesize\bf\color{white}| "Artificial Intelligence: A Modern Approach" by Peter Norvig and Stuart Russell}; % Drawing the Arrows from contributing branch to AI % Format: \arcarrow(above/below ID)(abobe/below ID)[shift] \arcarrow(below ML)(AROUND)[30]; \arcarrow(below SOLV)(AROUND)[24]; \arcarrow(below NLP)(AROUND)[15]; \arcarrow(below DEC)(AROUND)[-25]; \arcarrow(below REAS)(AROUND)[-17]; \arcarrow(below ROB)(AROUND)[-19]; \arcarrow(below RECO)(AROUND)[-33]; % Same level Arrows. Not needed now % \draw[myarrow] (left SSNX) -- (right DUAM); % \draw[myarrow] (left ML) -- (left SRel); % \draw[myarrow] (left SCap) -- (right ML); % Legend \draw[myarrow] (-5,-5) coordinate (legend) -- ++(.8,0) node[anchor=west] {(contribution)}; \draw [RedArc] (legend)++(0,-0.4) rectangle ++(.8,-.3)++(0,.2) node [anchor=west, text width=3em] {capabilities,\\disciplines}; \draw[SkyArc] (legend)++(0,-1) rectangle ++(.8,-.3)++(0,.2) node[anchor=west, color=black] {subfield}; % source, book and authors \node [text width=6.45cm] at (1,-5.6) {Source: \textit {"Artificial Intelligence: A Modern Approach"} \\by Peter Norvig and Stuart Russell}; % copyright \node[text width=3cm] at (3,-6.25) {\begin{tiny}Copyright \textcopyright Alfonso R. Reyes, 2020\end{tiny}}; \end{tikzpicture} \end{document}
\documentclass[crop, tikz]{standalone} \usepackage{tikz} \usepackage{amsmath} \usepackage{amssymb} \usepackage{xcolor} \usetikzlibrary{positioning, decorations.pathmorphing} \definecolor{olivegreen}{rgb}{0,0.6,0} \begin{document} \begin{tikzpicture} % boxes \path[rounded corners, fill=blue, fill opacity=0.2] (-0.4, 3.5) -- (-0.4, -3.5) -- (4, -3.5) -- (4, -0.2) -- (5, -0.2) -- (5, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \path[rounded corners, fill=red, fill opacity=0.2] (-0.4, -3.5) -- (-0.4, 3.5) -- (4, 3.5) -- (4, -0.2) -- (5, -0.2) -- (5, -3.5) -- (-0.4, -3.5) -- (-0.4, 0); \path[rounded corners, fill=white] (-0.4, 0) -- (-0.4, -3.5) -- (4, -3.5) -- (4, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \path[rounded corners, fill=olivegreen, fill opacity=0.2] (-0.4, 0) -- (-0.4, -3.5) -- (4, -3.5) -- (4, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); \path [draw, dashed, very thick, rectangle, rounded corners] (-0.4, 0) -- (-0.4, -3.5) -- (5, -3.5) -- (5, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); % add input nodes \node[circle, thick, fill=white, draw] (x1) {}; \node[circle, thick, draw, fill=white, below=1em of x1] (x2) {}; \node[circle, thick, fill=white, draw, below=1em of x2] (x3) {}; \node[circle, thick, fill=white, draw, below=1em of x3] (x4) {}; \node[circle, thick, fill=white, draw, below=1em of x4] (x5) {}; \node[circle, thick, fill=white, draw, above=1em of x1] (x6) {}; \node[circle, thick, fill=white, draw, above=1em of x6] (x7) {}; \node[circle, thick, fill=white, draw, above=1em of x7] (x8) {}; \node[circle, thick, fill=white, draw, above=1em of x8] (x9) {}; % add 2nd layer \node[circle, thick, right=4em of x1, fill=white, draw] (xhh1) {}; \node[circle, thick, draw, fill=white, below=1em of xhh1] (xhh2) {}; \node[circle, thick, fill=white, draw, below=1em of xhh2] (xhh3) {}; \node[circle, thick, fill=white, draw, below=1em of xhh3] (xhh4) {}; \node[circle, thick, fill=white, draw, above=1em of xhh1] (xhh5) {}; \node[circle, thick, fill=white, draw, above=1em of xhh5] (xhh6) {}; \node[circle, thick, fill=white, draw, above=1em of xhh6] (xhh7) {}; % 3rd layer \node[circle, thick, right=8em of x1, fill=white, draw] (xh1) {}; \node[circle, thick, draw, fill=white, below=1em of xh1] (xh2) {}; \node[circle, thick, fill=white, draw, below=1em of xh2] (xh3) {}; \node[circle, thick, fill=white, draw, below=1em of xh3] (xh4) {}; \node[circle, thick, fill=white, draw, above=1em of xh1] (xh5) {}; \node[circle, thick, fill=white, draw, above=1em of xh5] (xh6) {}; \node[circle, thick, fill=white, draw, above=1em of xh6] (xh7) {}; % output layer \node[circle, very thick, fill=blue!30, draw, right=12em of x1, yshift=5em] (hm1) {}; \node[circle, very thick, draw, fill=blue!30, below=0.5em of hm1] (hm2) {}; \node[circle, very thick, draw, fill=blue!30, below=0.5em of hm2] (hm3) {}; \node[circle, very thick, draw, fill=blue!30, above=0.5em of hm1] (hm4) {}; \node[circle, very thick, draw, fill=blue!30, above=0.5em of hm4] (hm5) {}; \node[circle, very thick, fill=red!30, draw, right=12em of x1, yshift=-5em] (hs1) {}; % add labels for output layer \node[right=1.5em of hm1, blue] (mu1) {$\pi_\theta(s, \alpha_3)$}; \node[right=1.5em of hm2, blue] (mu2) {$\pi_\theta(s, \alpha_4)$}; \node[right=1.5em of hm3, blue] (mu3) {$\pi_\theta(s, \alpha_5)$}; \node[right=1.5em of hm4, blue] (mu4) {$\pi_\theta(s, \alpha_2)$}; \node[right=1.5em of hm5, blue] (mu5) {$\pi_\theta(s, \alpha_1)$}; \node[right=1.5em of hs1, red] (s1) {$V_\psi(s)$}; % arrows between input layer and 2nd layer \foreach \x in {1,...,9} \foreach \y in {1,...,7} \draw[-stealth, thick] (x\x) -- (xhh\y); % arrows between 2nd layer and 3rd layer \foreach \x in {1,...,7} \foreach \y in {1,...,7} \draw[-stealth, thick] (xhh\x) -- (xh\y); % arrows between 3rd layer and upper output layer \foreach \x in {1,...,7} \foreach \y in {1,...,5} \draw[-stealth, thick, blue] (xh\x) -- (hm\y); % arrows between 3rd layer and lower output layer \foreach \x in {1,...,7} \draw[-stealth, thick, red] (xh\x) -- (hs1); % decorated arrows for main output variable \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick, red] (hs1) -- (s1); % decorated arrows between upper output nodes and labels \foreach \x in {1,...,5} \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick, blue] (hm\x) -- (mu\x); % label for the whole network \node[left=0.75em of x1] (l1) {$s$}; \end{tikzpicture} \end{document}
\documentclass[10pt]{article} \usepackage[paperwidth=210mm,% paperheight=297mm,% tmargin=7.5mm,% rmargin=7.5mm,% bmargin=7.5mm,% lmargin=7.5mm, vscale=1,% hscale=1]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usetikzlibrary{arrows, calc, decorations.markings, positioning} \pagestyle{empty} \makeatletter % create a timeline environment \newenvironment{timeline}[6]{% % #1 is startyear % #2 is tlendyear % #3 is yearcolumnwidth % #4 is rulecolumnwidth % #5 is entrycolumnwidth % #6 is timelineheight \newcommand{\startyear}{#1} \newcommand{\tlendyear}{#2} \newcommand{\yearcolumnwidth}{#3} \newcommand{\rulecolumnwidth}{#4} \newcommand{\entrycolumnwidth}{#5} \newcommand{\timelineheight}{#6} \newcommand{\templength}{} \newcommand{\entrycounter}{0} % https://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined % https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined \long\def\ifnodedefined##1##2##3{% \@ifundefined{pgf@sh@ns@##1}{##3}{##2}% } \newcommand{\ifnodeundefined}[2]{% \ifnodedefined{##1}{}{##2} } \newcommand{\drawtimeline}{% \draw[timelinerule] (\yearcolumnwidth+5pt, 0pt) -- (\yearcolumnwidth+5pt, -\timelineheight); \draw (\yearcolumnwidth+0pt, -10pt) -- (\yearcolumnwidth+10pt, -10pt); \draw (\yearcolumnwidth+0pt, -\timelineheight+15pt) -- (\yearcolumnwidth+10pt, -\timelineheight+15pt); \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\startyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))} \node[year] (year-\startyear) at (\yearcolumnwidth, \templength) {\startyear}; \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\tlendyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))} \node[year] (year-\tlendyear) at (\yearcolumnwidth, \templength) {\tlendyear}; } \newcommand{\entry}[2]{% % #1 is the year % #2 is the entry text \pgfmathtruncatemacro{\lastentrycount}{\entrycounter} \pgfmathtruncatemacro{\entrycounter}{\entrycounter + 1} \ifdim \lastentrycount pt > 0 pt% \node[entry] (entry-\entrycounter) [below of=entry-\lastentrycount] {##2}; \else% \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\startyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))} \node[entry] (entry-\entrycounter) at (\yearcolumnwidth+\rulecolumnwidth+10pt, \templength) {##2}; \fi \ifnodeundefined{year-##1}{% \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(##1, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))} \draw (\yearcolumnwidth+2.5pt, \templength) -- (\yearcolumnwidth+7.5pt, \templength); \node[year] (year-##1) at (\yearcolumnwidth, \templength) {##1}; } \draw ($(year-##1.east)+(2.5pt, 0pt)$) -- ($(year-##1.east)+(7.5pt, 0pt)$) -- ($(entry-\entrycounter.west)-(5pt,0)$) -- (entry-\entrycounter.west); } \newcommand{\plainentry}[2]{% plainentry won't print date in the timeline % #1 is the year % #2 is the entry text \pgfmathtruncatemacro{\lastentrycount}{\entrycounter} \pgfmathtruncatemacro{\entrycounter}{\entrycounter + 1} \ifdim \lastentrycount pt > 0 pt% \node[entry] (entry-\entrycounter) [below of=entry-\lastentrycount] {##2}; \else% \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\startyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))} \node[entry] (entry-\entrycounter) at (\yearcolumnwidth+\rulecolumnwidth+10pt, \templength) {##2}; \fi \ifnodeundefined{invisible-year-##1}{% \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(##1, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))} \draw (\yearcolumnwidth+2.5pt, \templength) -- (\yearcolumnwidth+7.5pt, \templength); \node[year] (invisible-year-##1) at (\yearcolumnwidth, \templength) {}; } \draw ($(invisible-year-##1.east)+(2.5pt, 0pt)$) -- ($(invisible-year-##1.east)+(7.5pt, 0pt)$) -- ($(entry-\entrycounter.west)-(5pt,0)$) -- (entry-\entrycounter.west); } \begin{tikzpicture} \tikzstyle{entry} = [% align=left,% text width=\entrycolumnwidth,% node distance=10mm,% anchor=west] \tikzstyle{year} = [anchor=east] \tikzstyle{timelinerule} = [% draw,% decoration={markings, mark=at position 1 with {\arrow[scale=1.5]{latex'}}},% postaction={decorate},% shorten >=0.4pt] \drawtimeline } { \end{tikzpicture} \let\startyear\@undefined \let\tlendyear\@undefined \let\yearcolumnwidth\@undefined \let\rulecolumnwidth\@undefined \let\entrycolumnwidth\@undefined \let\timelineheight\@undefined \let\entrycounter\@undefined \let\ifnodedefined\@undefined \let\ifnodeundefined\@undefined \let\drawtimeline\@undefined \let\entry\@undefined } % end of timeline environment \makeatother \begin{document} % first timeline \begin{timeline}{1900}{1990}{2cm}{2.5cm}{5cm}{12cm} \entry{1903}{Wilbur and Orville Wright fly the first powered airplane} \entry{1914}{Assassination of Franz Ferdinand} \plainentry{1917}{The October Revolution} \entry{1928}{Discovery of Penicillin} \plainentry{1929}{Stock Market Crash of 1929} \entry{1941}{Attack on Pearl Harbor} \plainentry{1944}{D-Day} \entry{1945}{The Bombing of Hiroshima} \plainentry{1947}{Creation of Israel as a Jewish State} \entry{1963}{US president John F. Kennedy assassinated in Dallas} \entry{1969}{The Moon Landing} \plainentry{1989}{Fall of the Berlin Wall} \end{timeline} \bigskip Text from: A Brief History of LaTeX http://www.xent.com/FoRK-archive/feb98/0307.html \smallskip % second timeline \begin{timeline}{1974}{1985}{2cm}{7cm}{10cm}{0.45\textheight} \entry{1974}{Donald Knuth stops submitting papers to the AMS because ``the finished product was just too painful for me to look at''.} \entry{1977}{Knuth begins his research on typography.} \entry{1978}{Knuth delivers an AMS Gibbs Lecture entitled Mathematical Typography to the AMS membership at its annual meeting.} \entry{1979}{Digital Equipment Corporation and the AMS jointly publish Knuth's TeX and METAFONT: New Directions in Typesetting.} \entry{1980}{The first draft of Spivak's Joy of TeX is announced in TUGboat, vol. 1, no. 1.} % multiple events on a year \entry{1982}{Spivak announces AMS-TeX at the joint math meetings.} \entry{1982}{Version 0 of Spivak's Joy of TeX is released.} \entry{1982}{Knuth releases dvitype, a model DVI driver.} \entry{1983}{Lamport writes a LaTeX manual, the earliest known LaTeX manual in existence.} % multiple events on a year \entry{1984}{Addison-Wesley publishes Knuth's The TeXbook, destined to become the definitive TeX reference.} \entry{1984}{Lamport releases version 2.06a of the LaTeX macros.} % multiple events on a year \entry{1985}{The Computer Modern (CM) fonts replace the American Modern (AM) fonts in TeX.} \entry{1985}{Patashnik releases BibTeX version 0.98 for LaTeX 2.08. [``BibTeX 1.0'', TUGboat, vol. 15, no. 3, pp. 269--274, Sept. 1994.} \end{timeline} \end{document}
\documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc,positioning,shadows.blur,decorations.pathreplacing} \usepackage{etoolbox} \tikzset{% brace/.style = { decorate, decoration={brace, amplitude=5pt} }, mbrace/.style = { decorate, decoration={brace, amplitude=5pt, mirror} }, label/.style = { black, midway, scale=0.5, align=center }, toplabel/.style = { label, above=.5em, anchor=south }, leftlabel/.style = { label,rotate=-90,left=.5em,anchor=north }, bottomlabel/.style = { label, below=.5em, anchor=north }, force/.style = { rotate=-90,scale=0.4 }, round/.style = { rounded corners=2mm }, legend/.style = { right,scale=0.4 }, nosep/.style = { inner sep=0pt }, generation/.style = { anchor=base }, dasher/.style = { orange, dashed } % color for graviton } % the style for each of the particles % #1 fill color; #2 symbol; #3 name; #4 mass; #5 spin; #6 charge; #7 colors % \newcommand\particle[7][white]{% \begin{tikzpicture}[x=1cm, y=1cm] \path[fill=#1,blur shadow={shadow blur steps=5}] (0.1,0) -- (0.9,0) arc (90:0:1mm) -- (1.0,-0.9) arc (0:-90:1mm) -- (0.1,-1.0) arc (-90:-180:1mm) -- (0,-0.1) arc(180:90:1mm) -- cycle; \ifstrempty{#7}{}{\path[fill=purple!50!white] % colors: band, purple (0.6,0) --(0.7,0) -- (1.0,-0.3) -- (1.0,-0.4);} \ifstrempty{#6}{}{\path[fill=green!50!black!50] (0.7,0) -- (0.9,0) % charge: corner, green arc (90:0:1mm) -- (1.0,-0.3);} \ifstrempty{#5}{}{\path[fill=orange!50!white] (1.0,-0.7) -- (1.0,-0.9) % spin: bottom corner, orange arc (0:-90:1mm) -- (0.7,-1.0);} \draw[\ifstrempty{#2}{dasher}{black}] (0.1,0) -- (0.9,0) % line arc (90:0:1mm) -- (1.0,-0.9) arc (0:-90:1mm) -- (0.1,-1.0) arc (-90:-180:1mm) -- (0,-0.1) arc(180:90:1mm) -- cycle; \ifstrempty{#7}{}{\node at(0.825,-0.175) [rotate=-45,scale=0.2] {#7};} % colors \ifstrempty{#6}{}{\node at(0.9,-0.1) [nosep,scale=0.17] {#6};} % charge \ifstrempty{#5}{}{\node at(0.9,-0.9) [nosep,scale=0.2] {#5};} % spin \ifstrempty{#4}{}{\node at(0.1,-0.1) [nosep,anchor=west,scale=0.25]{#4};} % mass \ifstrempty{#3}{}{\node at(0.1,-0.85) [nosep,anchor=west,scale=0.3] {#3};} % name \ifstrempty{#2}{}{\node at(0.1,-0.5) [nosep,anchor=west,scale=1.5] {#2};} % symbol \end{tikzpicture} } \begin{document} \begin{tikzpicture}[x=1.2cm, y=1.2cm] % draw force blocks \draw[round] (-0.5,0.5) rectangle (4.4,-1.5); % strong force \draw[round] (-0.6,0.6) rectangle (5.0,-2.5); % electromagnetic force \draw[round] (-0.7,0.7) rectangle (5.6,-3.5); % weak force % draw all particles \node at(0, 0) {\particle[gray!20!white] {$u$} {up} {$2.3$ MeV}{1/2}{$2/3$}{R/G/B}}; \node at(0,-1) {\particle[gray!20!white] {$d$} {down} {$4.8$ MeV}{1/2}{$-1/3$}{R/G/B}}; \node at(0,-2) {\particle[gray!20!white] {$e$} {electron} {$511$ keV}{1/2}{$-1$}{}}; \node at(0,-3) {\particle[gray!20!white] {$\nu_e$} {$e$ neutrino} {$<2$ eV}{1/2}{}{}}; \node at(1, 0) {\particle {$c$} {charm} {$1.28$ GeV}{1/2}{$2/3$}{R/G/B}}; \node at(1,-1) {\particle {$s$} {strange} {$95$ MeV}{1/2}{$-1/3$}{R/G/B}}; \node at(1,-2) {\particle {$\mu$} {muon} {$105.7$ MeV}{1/2}{$-1$}{}}; \node at(1,-3) {\particle {$\nu_\mu$} {$\mu$ neutrino} {$<190$ keV}{1/2}{}{}}; \node at(2, 0) {\particle {$t$} {top} {$173.2$ GeV}{1/2}{$2/3$}{R/G/B}}; \node at(2,-1) {\particle {$b$} {bottom} {$4.7$ GeV}{1/2}{$-1/3$}{R/G/B}}; \node at(2,-2) {\particle {$\tau$} {tau} {$1.777$ GeV}{1/2}{$-1$}{}}; \node at(2,-3) {\particle {$\nu_\tau$} {$\tau$ neutrino} {$<18.2$ MeV}{1/2}{}{}}; \node at(3,-3) {\particle[orange!20!white] {$W^{\hspace{-.3ex}\scalebox{.5}{$\pm$}}$} {} {$80.4$ GeV}{1}{$\pm1$}{}}; % W \node at(4,-3) {\particle[orange!20!white] {$Z$} {} {$91.2$ GeV}{1}{}{}}; % Z \node at(3.5,-2) {\particle[green!50!black!20] {$\gamma$} {photon} {}{1}{}{}}; % gamma-photon \node at(3.5,-1) {\particle[purple!20!white] {$g$} {gluon} {}{1}{}{color}}; % g-gluon \node at(5,0) {\particle[gray!50!white] {$H$} {Higgs} {$125.1$ GeV}{0}{}{}}; % H-Higgs \node at(6.1,-3) {\particle[gray!5!white] {} {graviton} {}{}{}{}}; % graviton % add text labels for forces \node at(4.25,-0.5) [force] {strong nuclear force (color)}; \node at(4.85,-1.5) [force] {electromagnetic force (charge)}; \node at(5.45,-2.4) [force] {weak nuclear force (weak isospin)}; \node at(6.75,-2.5) [force] {gravitational force (mass)}; % draw arrows and add labels for legends \draw [<-] (2.50,0.30) -- (2.7,0.3) node [legend] {charge}; \draw [<-] (2.50,0.15) -- (2.7,0.15) node [legend] {colors}; \draw [<-] (2.05,0.25) -- (2.3,0) -- (2.7,0) node [legend] {mass}; \draw [<-] (2.50,-0.3) -- (2.7,-0.3) node [legend] {spin}; % draw vertical braces and labels \draw [mbrace] (-0.8,0.5) -- (-0.8,-1.5) node[leftlabel] {6 quarks\\(+6 anti-quarks)}; \draw [mbrace] (-0.8,-1.5) -- (-0.8,-3.5) node[leftlabel] {6 leptons\\(+6 anti-leptons)}; % draw bottom braces and labels \draw [mbrace] (-0.5,-3.6) -- (2.5,-3.6) node[bottomlabel] {12 fermions\\(+12 anti-fermions)\\increasing mass $\to$}; \draw [mbrace] (2.5,-3.6) -- (5.5,-3.6) node[bottomlabel] {5 bosons\\(+1 opposite charge $W$)}; % draw top braces and add text labels \draw [brace] (-0.5,.8) -- (0.5,.8) node[toplabel] {standard matter}; \draw [brace] (0.5,.8) -- (2.5,.8) node[toplabel] {unstable matter}; \draw [brace] (2.5,.8) -- (4.5,.8) node[toplabel] {force carriers}; \draw [brace] (4.5,.8) -- (5.5,.8) node[toplabel] {Goldstone\\bosons}; % two lines \draw [brace] (5.5,.8) -- (7,.8) node[toplabel] {outside\\standard model}; % two lines % add big numbers on top \node at (0,1.2) [generation] {1\tiny st}; \node at (1,1.2) [generation] {2\tiny nd}; \node at (2,1.2) [generation] {3\tiny rd}; \node at (2.8,1.2) [generation] {\tiny generation}; \end{tikzpicture} \end{document}
\documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{arrows} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% %%%> \begin{comment} :Title: Polarizing microscope :Tags: 3D; Earth Sciences; Petrography; Physics :Author: Cyril Langlois This TikZ code sketches the light behavior during its travel in a polarizing petrographic microscope when a birefringent crystal thin section is inserted between the polarizing devices. The goal was to correctly show the vectorial relationships between light electric fields during its travel through the first polaroid, the mineral section and the second polaroid. \end{comment} \begin{document} \begin{tikzpicture}[x={(0.866cm,-0.5cm)}, y={(0.866cm,0.5cm)}, z={(0cm,1cm)}, scale=1.0, %Option for nice arrows >=stealth, % inner sep=0pt, outer sep=2pt,% axis/.style={thick,->}, wave/.style={thick,color=#1,smooth}, polaroid/.style={fill=black!60!white, opacity=0.3}, ] % Colors \colorlet{darkgreen}{green!50!black} \colorlet{lightgreen}{green!80!black} \colorlet{darkred}{red!50!black} \colorlet{lightred}{red!80!black} % Frame \coordinate (O) at (0, 0, 0); \draw[axis] (O) -- +(14, 0, 0) node [right] {x}; \draw[axis] (O) -- +(0, 2.5, 0) node [right] {y}; \draw[axis] (O) -- +(0, 0, 2) node [above] {z}; \draw[thick,dashed] (-2,0,0) -- (O); % monochromatic incident light with electric field \draw[wave=blue, opacity=0.7, variable=\x, samples at={-2,-1.75,...,0}] plot (\x, { cos(1.0*\x r)*sin(2.0*\x r)}, { sin(1.0*\x r)*sin(2.0*\x r)}) plot (\x, {-cos(1.0*\x r)*sin(2.0*\x r)}, {-sin(1.0*\x r)*sin(2.0*\x r)}); \foreach \x in{-2,-1.75,...,0}{ \draw[color=blue, opacity=0.7,->] (\x,0,0) -- (\x, { cos(1.0*\x r)*sin(2.0*\x r)}, { sin(1.0*\x r)*sin(2.0*\x r)}) (\x,0,0) -- (\x, {-cos(1.0*\x r)*sin(2.0*\x r)}, {-sin(1.0*\x r)*sin(2.0*\x r)}); } \filldraw[polaroid] (0,-2,-1.5) -- (0,-2,1.5) -- (0,2,1.5) -- (0,2,-1.5) -- (0,-2,-1.5) node[below, sloped, near end]{Polaroid};% %Direction of polarization \draw[thick,<->] (0,-1.75,-1) -- (0,-0.75,-1); % Electric field vectors \draw[wave=blue, variable=\x,samples at={0,0.25,...,6}] plot (\x,{sin(2*\x r)},0)node[anchor=north]{$\vec{E}$}; %Polarized light between polaroid and thin section \foreach \x in{0, 0.25,...,6} \draw[color=blue,->] (\x,0,0) -- (\x,{sin(2*\x r)},0); \draw (3,1,1) node [text width=2.5cm, text centered]{Polarized light}; %Crystal thin section \begin{scope}[thick] \draw (6,-2,-1.5) -- (6,-2,1.5) node [above, sloped, midway]{Crystal section} -- (6, 2, 1.5) -- (6, 2, -1.5) -- cycle % First face (6, -2, -1.5) -- (6.2, -2,-1.5) (6, 2, -1.5) -- (6.2, 2,-1.5) (6, -2, 1.5) -- (6.2, -2, 1.5) (6, 2, 1.5) -- (6.2, 2, 1.5) (6.2,-2, -1.5) -- (6.2, -2, 1.5) -- (6.2, 2, 1.5) -- (6.2, 2, -1.5) -- cycle; % Second face %Optical indices \draw[darkred, ->] (6.1, 0, 0) -- (6.1, 0.26, 0.966) node [right] {$n_{g}'$}; % index 1 \draw[darkred, dashed] (6.1, 0, 0) -- (6.1,-0.26, -0.966); % index 1 \draw[darkgreen, ->] (6.1, 0, 0) -- (6.1, 0.644,-0.173) node [right] {$n_{p}'$}; % index 2 \draw[darkgreen, dashed] (6.1, 0, 0) -- (6.1,-0.644, 0.173); % index 2 \end{scope} %Rays leaving thin section \draw[wave=darkred, variable=\x, samples at={6.2,6.45,...,12}] plot (\x, {0.26*0.26*sin(2*(\x-0.5) r)}, {0.966*0.26*sin(2*(\x-0.5) r)}); %n'g-oriented ray \draw[wave=darkgreen, variable=\x, samples at={6.2,6.45,...,12}] plot (\x, {0.966*0.966*sin(2*(\x-0.1) r)},{-0.26*0.966*sin(2*(\x-0.1) r)}); %n'p-oriented ray \draw (10,1,1) node [text width=2.5cm, text centered] {Polarized and dephased light}; \foreach \x in{6.2,6.45,...,12} { \draw[color=darkgreen, ->] (\x, 0, 0) -- (\x, {0.966*0.966*sin(2*(\x-0.1) r)}, {-0.26*0.966*sin(2*(\x-0.1) r)}); \draw[color=darkred, ->] (\x, 0, 0) -- (\x, {0.26*0.26*sin(2*(\x-0.5) r)}, {0.966*0.26*sin(2*(\x-0.5) r)}); } %Second polarization \draw[polaroid] (12, -2, -1.5) -- (12, -2, 1.5) %Polarizing filter node [above, sloped,midway] {Polaroid} -- (12, 2, 1.5) -- (12, 2, -1.5) -- cycle; \draw[thick, <->] (12, -1.5,-0.5) -- (12, -1.5, 0.5); %Polarization direction %Light leaving the second polaroid \draw[wave=lightgreen,variable=\x, samples at={12, 12.25,..., 14}] plot (\x,{0}, {0.966*0.966*0.26*sin(2*(\x-0.5) r)}); %n'g polarized ray \draw[wave=lightred, variable=\x, samples at={12, 12.25,..., 14}] plot (\x,{0}, {-0.26*0.966*sin(2*(\x-0.1) r)}); %n'p polarized ray \node[align=justify, text width=14cm, anchor=north west, yshift=-2mm] at (current bounding box.south west) {Light behavior in a petrographic microscope with light polarizing device. Only one incident wavelength is shown (monochromatic light). The magnetic field, perpendicular to the electric one, is not drawn.}; \end{tikzpicture} \end{document}
% Author: Izaak Neutelings (May 2018) % Inspiration: https://tex.stackexchange.com/questions/113900/draw-polarized-light \documentclass[border=3pt,tikz]{article} \usepackage[top=0.25in, bottom=0.25in]{geometry} \usepackage{amsmath} % for \text \usepackage{tikz} \tikzset{>=latex} % for LaTeX arrow head \usepackage{xcolor} \colorlet{myblue}{black!40!blue} \colorlet{myred}{black!40!red} \begin{document} % Electromagnetic wave - black \begin{tikzpicture}[x=(-15:1.2), y=(90:1.0), z=(-150:1.0), line cap=round, line join=round, axis/.style={black, thick,->}, vector/.style={>=stealth,->}] \large \def\A{1.5} \def\nNodes{5} % use even number \def\nVectorsPerNode{8} \def\N{\nNodes*40} \def\xmax{\nNodes*pi/2*1.01} \pgfmathsetmacro\nVectors{(\nVectorsPerNode+1)*\nNodes} \def\vE{\mathbf{E}} \def\vB{\mathbf{B}} \def\vk{\mathbf{\hat{k}}} % main axes \draw[axis] (0,0,0) -- ++(\xmax*1.1,0,0) node[right] {$x$}; \draw[axis] (0,-\A*1.4,0) -- (0,\A*1.4,0) node[right] {$y$}; \draw[axis] (0,0,-\A*1.4) -- (0,0,\A*1.4) node[above left] {$z$}; % small axes \def\xOffset{{(\nNodes-2)*pi/2}} \def\yOffset{\A*1.2} \def\zOffset{\A*1.2} \draw[axis] (\xOffset,\yOffset,-\zOffset) -- ++(\A*0.6,0,0) node[right] {$\vk$}; \draw[axis] (\xOffset,\yOffset,-\zOffset) -- ++(0,\A*0.6,0) node[right] {$\vE$}; \draw[axis] (\xOffset,\yOffset,-\zOffset) -- ++(0,0,\A*0.6) node[above left] {$\vB$}; % equation \node[above right] at (\xOffset,-0.5*\yOffset,4*\zOffset) {$\begin{aligned} \vE &= \mathbf{E_0}\sin(\vk\cdot\mathbf{x}-c_0t)\\ \vB &= \mathbf{B_0}\sin(\vk\cdot\mathbf{x}-c_0t)\\ \end{aligned}$}; \node[below right] at (\xOffset,-0.5*\yOffset,4*\zOffset) {$\vE\cdot\vk = 0,\;\; \vB\cdot\vk = 0,\;\; \vB = \frac{1}{c_0}\vk\times\vE$}; % waves \draw[very thick,variable=\t,domain=0:\nNodes*pi/2*1.01,samples=\N] plot (\t,{\A*sin(\t*360/pi)},0); \draw[very thick,variable=\t,domain=0:\nNodes*pi/2*1.01,samples=\N] plot (\t,0,{\A*sin(\t*360/pi)}); % draw vectors \foreach \k [evaluate={\t=\k*pi/2/(\nVectorsPerNode+1); \angle=\k*90/(\nVectorsPerNode+1); \c=(mod(\angle,90)!=0);}] in {1,...,\nVectors}{ \if\c1 \draw[vector] (\t,0,0) -- ++(0,{\A*sin(2*\angle)},0); \draw[vector] (\t,0,0) -- ++(0,0,{\A*sin(2*\angle)}); \fi } \end{tikzpicture} % Electromagnetic wave - circular polarization \begin{tikzpicture}[x=(-15:0.8), y=(90:1.0), z=(-150:1.0), line cap=round, line join=round, axis/.style={black, thick,->}, vector/.style={>=stealth,->}] \large \def\A{1.5} \def\nNodes{8} % use even number \def\nVectorsPerNode{8} \def\N{\nNodes*40} \def\xmax{\nNodes*pi/2*1.01} \pgfmathsetmacro\nVectors{\nVectorsPerNode*\nNodes} \def\vE{\mathbf{E}} \def\vB{\mathbf{B}} \def\vk{\mathbf{\hat{k}}} % main axes \draw[axis] (0,0,0) -- ++(\xmax*1.1,0,0) node[right] {$x$}; \draw[axis] (0,-\A*1.4,0) -- (0,\A*1.4,0) node[right] {$y$}; \draw[axis] (0,0,-\A*1.4) -- (0,0,\A*1.4) node[above left] {$z$}; % waves \draw[very thick,variable=\t,domain=0:\nNodes*pi/2*1.01,samples=\N] plot (\t,{\A*cos(\t*360/pi)},{\A*sin(\t*360/pi)}); % draw vectors \foreach \k [evaluate={\t=\k*pi/2/\nVectorsPerNode; \angle=\k*90/\nVectorsPerNode;}] in {1,...,\nVectors}{ \draw[vector] (\t,0,0) -- ++(0,{\A*cos(2*\angle)},{\A*sin(2*\angle)}); } \end{tikzpicture} % Electromagnetic wave - colored \begin{tikzpicture}[x=(-15:1.2), y=(90:1.0), z=(-150:1.0), line cap=round, line join=round, axis/.style={black, thick,->}, vector/.style={>=stealth,->}] \large \def\A{1.5} \def\nNodes{5} % use even number \def\nVectorsPerNode{8} \def\N{\nNodes*40} \def\xmax{\nNodes*pi/2*1.01} \pgfmathsetmacro\nVectors{(\nVectorsPerNode+1)*\nNodes} \def\vE{{\color{myblue}\mathbf{E}}} \def\vB{{\color{myred}\mathbf{B}}} \def\vk{\mathbf{\hat{k}}} \def\drawENode{ % draw E node and vectors with some offset \draw[myblue,very thick,variable=\t,domain=\iOffset*pi/2:(\iOffset+1)*pi/2*1.01,samples=40] plot (\t,{\A*sin(\t*360/pi)},0); \foreach \k [evaluate={\t=\k*pi/2/(\nVectorsPerNode+1); \angle=\k*90/(\nVectorsPerNode+1);}] in {1,...,\nVectorsPerNode}{ \draw[vector,myblue!50] (\iOffset*pi/2+\t,0,0) -- ++(0,{\A*sin(2*\angle+\iOffset*180)},0); } } \def\drawBNode{ % draw B node and vectors with some offset \draw[myred,very thick,variable=\t,domain=\iOffset*pi/2:(\iOffset+1)*pi/2*1.01,samples=40] plot (\t,0,{\A*sin(\t*360/pi)}); \foreach \k [evaluate={\t=\k*pi/2/(\nVectorsPerNode+1); \angle=\k*90/(\nVectorsPerNode+1);}] in {1,...,\nVectorsPerNode}{ \draw[vector,myred!50] (\iOffset*pi/2+\t,0,0) -- ++(0,0,{\A*sin(2*\angle+\iOffset*180)}); } } % main axes \draw[axis] (0,0,0) -- ++(\xmax*1.1,0,0) node[right] {$x$}; \draw[axis] (0,-\A*1.4,0) -- (0,\A*1.4,0) node[right] {$y$}; \draw[axis] (0,0,-\A*1.4) -- (0,0,\A*1.4) node[above left] {$z$}; % small axes \def\xOffset{{(\nNodes-2)*pi/2}} \def\yOffset{\A*1.2} \def\zOffset{\A*1.2} \draw[axis,black] (\xOffset,\yOffset,-\zOffset) -- ++(\A*0.6,0,0) node[right,align=center] {$\mathbf{\hat{k}}$}; %\\propagation \draw[axis,myblue] (\xOffset,\yOffset,-\zOffset) -- ++(0,\A*0.6,0) node[right] {$\mathbf{E}$}; \draw[axis,myred] (\xOffset,\yOffset,-\zOffset) -- ++(0,0,\A*0.6) node[above left] {$\mathbf{B}$}; % equation \node[above right] at (\xOffset,-0.5*\yOffset,4*\zOffset) {$\begin{aligned} \vE &= {\color{myblue}\mathbf{E_0}}\sin(\vk\cdot\mathbf{x}-c_0t)\\ \vB &= {\color{myred} \mathbf{B_0}}\sin(\vk\cdot\mathbf{x}-c_0t)\\ \end{aligned}$}; \node[below right] at (\xOffset,-0.5*\yOffset,4*\zOffset) {$\vE\cdot\vk = 0,\;\; \vB\cdot\vk = 0,\;\; \vB = \frac{1}{c_0}\vk\times\vE$}; % draw (anti-)nodes \foreach \iNode [evaluate={\iOffset=\iNode-1;}] in {1,...,\nNodes}{ \ifodd\iNode \drawBNode \drawENode % E overlaps B \else \drawENode \drawBNode % B overlaps E \fi } \end{tikzpicture} \end{document}
% arr: change colors. \documentclass{minimal} \usepackage[a4paper,margin=1cm,landscape]{geometry} \usepackage{tikz} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% %%%> \begin{comment} :Title: Class diagram \end{comment} \usetikzlibrary{positioning,shapes,shadows,arrows} \begin{document} \tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=black!40!blue!60, drop shadow, text centered, anchor=north, text=white, text width=3cm] \tikzstyle{comment}=[rectangle, draw=black, rounded corners, fill=black!60!green, drop shadow, text centered, anchor=north, text=white, text width=3cm] \tikzstyle{myarrow}=[->, >=open triangle 90, thick] \tikzstyle{line}=[-, thick] \begin{center} \begin{tikzpicture}[node distance=2cm] \node (Item) [abstract, rectangle split, rectangle split parts=2] { \textbf{ITEM} \nodepart{second}name }; \node (AuxNode01) [text width=4cm, below=of Item] {}; \node (Component) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode01] { \textbf{COMPONENT} \nodepart{second}nil }; \node (System) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode01] { \textbf{SYSTEM} \nodepart{second}parts }; \node (AuxNode02) [text width=0.5cm, below=of Component] {}; \node (Sensor) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode02] { \textbf{SENSOR} \nodepart{second}nil }; \node (Part) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode02] { \textbf{PART} \nodepart{second}nil }; \node (AuxNode03) [below=of Sensor] {}; \node (Pressure) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode03, xshift=2cm] { \textbf{Pressure} \nodepart{second}nil }; \node (Temperature) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode03, xshift=-2cm] { \textbf{Temperature} \nodepart{second}nil }; \node (PressureInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Pressure, text justified] { \textbf{Instants} \nodepart{second}fw-p-suction\newline fw-p-delivery\newline fw-p-loop\newline sw-p-suction\newline sw-p-delivery \newline sw-p-loop }; \node (ClOp) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of PressureInstants] { \textbf{Closed/Open} \nodepart{second}nil }; \node (ClOpInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of ClOp, text justified] { \textbf{Instants} \nodepart{second}fw-clop-warm-up\newline sw-clop-control }; \node (TemperatureInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Temperature, text justified] { \textbf{Instants} \nodepart{second}fw-t-engine\newline fw-t-heat-exch.\newline sw-t-heat-exch. }; \node (Level) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of TemperatureInstants] { \textbf{Level} \nodepart{second}nil }; \node (LevelInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Level, text justified] { \textbf{Instants} \nodepart{second}fw-l-tank }; \node (Ammeter) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of LevelInstants] { \textbf{Ammeter} \nodepart{second}nil }; \node (AmmeterInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Ammeter, text justified] { \textbf{Instants} \nodepart{second}fw-pump-ammeter\newline sw-pump-ammeter }; \node (AuxNode04) [below=of Part] {}; \node (Pump) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode04, xshift=2cm] { \textbf{Pump} \nodepart{second}nil }; \node (Valve) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode04, xshift=-2cm] { \textbf{Valve} \nodepart{second}nil }; \node (PumpInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Pump, text justified] { \textbf{Instants} \nodepart{second}fw-pump\newline sw-pump }; \node (Tank) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of PumpInstants] { \textbf{Tank} \nodepart{second}nil }; \node (ValveInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Valve, text justified] { \textbf{Instants} \nodepart{second}fw-suction-valve\newline fw-delivery-valve\newline sw-suction-valve\newline sw-delivery-valve \newline sw-discharge-valve\newline sw-control-valve }; \node (Engine) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of ValveInstants] { \textbf{Engine} \nodepart{second}nil }; \node (TankInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Tank, text justified] { \textbf{Instants} \nodepart{second}fw-expansion-tank }; \node (HeatExchanger) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of TankInstants] { \textbf{Heat Exchanger} \nodepart{second}nil }; \node (HeatExchangerInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of HeatExchanger, text justified] { \textbf{Instants} \nodepart{second}fw-heat-exchanger }; \node (EngineInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Engine, text justified] { \textbf{Instants} \nodepart{second}fw-engine }; \node (Strainer) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of HeatExchangerInstants] { \textbf{Strainer} \nodepart{second}nil }; \node (StrainerInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Strainer, text justified] { \textbf{Instants} \nodepart{second}sw-strainer }; \node (Coolant) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of EngineInstants] { \textbf{Coolant} \nodepart{second}nil }; \node (CoolantInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Coolant, text justified] { \textbf{Instants} \nodepart{second}fw-coolant\newline sw-coolant }; \node (AuxNode05) [below=of System] {}; \node (CoolingSystem) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode05, xshift=2cm] { \textbf{Cooling System} \nodepart{second}nil }; \node (CoolingLoop) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode05, xshift=-2cm] { \textbf{Cooling Loop} \nodepart{second}nil }; \node (CoolingSystemInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of CoolingSystem, text justified] { \textbf{Instants} \nodepart{second}cool }; \node (CoolingLoopInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of CoolingLoop, text justified] { \textbf{Instants} \nodepart{second}fw-loop\newline sw-loop }; \draw[myarrow] (Component.north) -- ++(0,0.8) -| (Item.south); \draw[line] (Component.north) -- ++(0,0.8) -| (System.north); \draw[myarrow] (Sensor.north) -- ++(0,0.8) -| (Component.south); \draw[line] (Sensor.north) -- ++(0,0.8) -| (Part.north); \draw[line] (Pressure.west) -- ++(-0.2,0); \draw[line] (Temperature.east) -- ++(0.2,0); \draw[line] (Level.east) -- ++(0.2,0); \draw[myarrow] (ClOp.west) -- ++(-0.2,0) -- ([yshift=0.5cm, xshift=-0.2cm] Pressure.north west) -| ([xshift=-1cm]Sensor.south); \draw[myarrow] (Ammeter.east) -- ++(0.2,0) -- ([yshift=0.5cm, xshift=0.2cm] Temperature.north east) -| ([xshift=1cm]Sensor.south); \draw[line] (Tank.west) -- ++(-0.2,0); \draw[line] (HeatExchanger.west) -- ++(-0.2,0); \draw[line] (Pump.west) -- ++(-0.2,0); \draw[line] (Valve.east) -- ++(0.2,0); \draw[line] (Engine.east) -- ++(0.2,0); \draw[myarrow] (Strainer.west) -- ++(-0.2,0) -- ([yshift=0.5cm, xshift=-0.2cm] Pump.north west) -| ([xshift=-1cm]Part.south); \draw[myarrow] (Coolant.east) -- ++(0.2,0) -- ([yshift=0.5cm, xshift=0.2cm] Valve.north east) -| ([xshift=1cm]Part.south); \draw[myarrow] (CoolingSystem.north) -- ++(0,0.8) -| (System.south); \draw[line] (CoolingSystem.north) -- ++(0,0.8) -| (CoolingLoop.north); \end{tikzpicture} \end{center} \end{document}
\documentclass[border=5pt]{standalone} \usepackage{xcolor} \usepackage{ulem} \definecolor{ocre}{HTML}{800000} \definecolor{sky}{HTML}{C6D9F1} \definecolor{skybox}{HTML}{5F86B3} \usepackage{tikz} \usepackage{pgfmath} \usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings} \renewcommand*\familydefault{\sfdefault} % Set font to serif family % arctext from Andrew code with modifications: %Variables: 1: ID, 2:Style 3:box height 4: Radious 5:start-angl 6:end-angl 7:text {format along path} \def\arctext[#1][#2][#3](#4)(#5)(#6)#7{ \draw[#2] (#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3) -- (#6:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1) arc (#6:#5:#4cm-#3) coordinate (below #1) -- (#5:#4) coordinate (left #1) -- cycle; \def\a#1{#4cm+#3} \def\b#1{#4cm-#3} \path[ decoration={ raise = -0.5ex, % Controls relavite text height position. text along path, text = {#7}, text align = center, }, decorate ] (#5:#4) arc (#5:#6:#4); } % arcarrow, this is mine, for beerware purpose... % Function: Draw an arrow from arctex coordinate specific nodes to another % Arrow start at the start of arctext box and could be shifted to change the position % to avoid go over another box. % Var: 1:Start coordinate 2:End coordinate 3:angle to shift from acrtext box \def\arcarrow(#1)(#2)[#3]{ \draw[very thick,->,>=latex,black!60] let \p1 = (#1), \p2 = (#2), % To access cartesian coordinates x, and y. \n1 = {veclen(\x1,\y1)}, % Distance from the origin \n2 = {veclen(\x2,\y2)}, % Distance from the origin \n3 = {atan2(\y1,\x1)} % Angle where acrtext starts. in (\n3-#3: \n1) -- (\n3-#3: \n2); % Draw the arrow. } \begin{document} \begin{tikzpicture}[ % Environment Cfg font=\sf \scriptsize, % Styles myarrow/.style={ thick, -latex, black!60, }, Center/.style ={ circle, fill=ocre, text=white, align=center, font =\footnotesize\bf, inner sep=1pt, }, RedArc/.style ={ color=black, thick, fill=ocre, blur shadow, }, SkyArc/.style ={ color=skybox, thick, fill=sky, blur shadow, }, ] % Drawing the center for AI \node[Center](AI) at (0,0) { Artificial \\ Intelligence \\(AI)\\ Agent}; \coordinate (AROUND) at (0:1.2); % Drawing the Text Arcs % Format: \Arctext[ID][box-style][box-height](radious)(start-angl)(end-angl){|text-styles| Text} % Logic \arctext[LOGI][RedArc][8pt](2.5)(120)(70){|\footnotesize\bf\color{white}| Logic}; \arcarrow(below LOGI)(AROUND)[25]; % Search \arctext[SRCH][RedArc][8pt](2.5)(60)(20){|\footnotesize\bf\color{white}| Search}; \arcarrow(below SRCH)(AROUND)[20]; % Pattern Recognition \arctext[RECO][RedArc][8pt](2.5)(-60)(10){|\footnotesize\bf\color{white}| Pattern Recognition}; \arcarrow(below RECO)(AROUND)[-35]; % Representation \arctext[REPR][RedArc][8pt](2.5)(240)(290){|\footnotesize\bf\color{white}| Representation}; \arcarrow(below REPR)(AROUND)[-25]; % Inference \arctext[INFE][RedArc][8pt](2.5)(190)(230){|\footnotesize\bf\color{white} | Inference}; \arcarrow(below INFE)(AROUND)[-20]; % Reasoning \arctext[REAS][RedArc][8pt](2.5)(180)(130){|\footnotesize\bf\color{white} | Reasoning}; \arcarrow(below REAS)(AROUND)[25]; % Epistemology \arctext[EPIS][RedArc][8pt](3.30)(220)(260){|\footnotesize\bf\color{white}| Epistemology}; % Planning \arctext[PLAN][RedArc][8pt](3.30)(210)(160){|\footnotesize\bf\color{white}| Planning}; % Learning \arctext[LEAR][RedArc][8pt](3.30)(150)(110){|\footnotesize\bf\color{white}| Learning}; % Ontology \arctext[ONTO][RedArc][8pt](3.30)(90)(50){|\footnotesize\bf\color{white}| Ontology}; % Heuristics \arctext[HEUR][RedArc][8pt](3.30)(40)(-10){|\footnotesize\bf\color{white}| Heuristics}; % Genetic Programming \arctext[GENE][RedArc][8pt](3.30)(270)(330){|\footnotesize\bf\color{white}| Genetic Programming}; % %ADITIONAL EXTERNAL ARC % \arctext[NEW][ % color=white, % shade, % upper left=gray!7, % upper right=gray!7, % lower left=gray!7, % lower right=gray!7, % rounded corners = 8pt % ][8pt](5.2)(180)(0){|\footnotesize\bf\color{black}| Interpration of "What is AI? / Branches of AI" article by Prof. John McCarthy.}; % Drawing the Arrows from contributing branch to AI % Format: \arcarrow(above/below ID)(abobe/below ID)[shift] \arcarrow(below LEAR)(AROUND)[25]; \arcarrow(below ONTO)(AROUND)[25]; \arcarrow(below HEUR)(AROUND)[25]; \arcarrow(below GENE)(AROUND)[-25]; \arcarrow(below EPIS)(AROUND)[-15]; \arcarrow(below PLAN)(AROUND)[25]; % Legend and labels \draw[myarrow] (-5,-5) coordinate (legend) -- ++(.8,0) node[anchor=west] {(contribution)}; \draw[RedArc] (legend)++(0,-0.4) rectangle ++(.8,-.3)++(0,.2) node[anchor=west, text width=3em] {capabilities,\\disciplines}; \draw[SkyArc] (legend)++(0,-1) rectangle ++(.8,-.3)++(0,.2) node[anchor=west, color=black] {subfield}; % source, book and authors \node [text width=5.5cm] at (1,-5.6) {Source: \textit {"What is AI? / Branches of AI"} article by Prof. John McCarthy. Stanford University.}; % copyright \node[text width=3cm] at (3.25,-6.25) {\begin{tiny}Copyright \textcopyright Alfonso R. Reyes, 2020\end{tiny}}; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \usepackage{verbatim} \usetikzlibrary{shapes,shadows,positioning,arrows,calc,matrix,decorations.markings,decorations.pathreplacing} % like standalone \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% \begin{document} \definecolor{colone}{RGB}{209,220,204} \definecolor{coltwo}{RGB}{204,222,210} \definecolor{colthree}{RGB}{207,233,232} \definecolor{colfour}{RGB}{248,243,214} \definecolor{colfive}{RGB}{245,238,197} \definecolor{colsix}{RGB}{243,235,179} \definecolor{colseven}{RGB}{241,231,163} \definecolor{colortop}{RGB}{184,223,155} \definecolor{colorside}{RGB}{0,209,54} \begin{figure} \begin{tikzpicture}[every node/.style={minimum size=1cm,font=\scriptsize},on grid] \begin{scope}[every node/.append style={yslant=-0.5},yslant=-0.5] \shade[right color=colorside!30, left color=colorside!50] (-1,0) rectangle +(4,3); \node at (-0.5,2.25) {}; \node at (0.5,2.75) {$Sex$}; \node at (1.5,2.75) {$Age$}; \node at (2.5,2.75) {$Area$}; \node at (-0.5,1.25) {$User_3$}; \node at (-0.5,0.75) {$...$}; \node at (0.5,0.75) {$...$}; \node at (2.5,0.75) {$...$}; \node at (0.5,1.25) {$*$}; \node at (1.5,1.25) {$4$}; \node at (2.5,1.25) {$0$}; \node at (-0.5,0.25) {$User_n$}; \node at (1.5,0.75) {$...$}; \node at (-0.5,2.25) {$user_1$}; \node at (0.5,2.25) {$0$}; \node at (1.5,2.25) {$*$}; \node at (2.5,2.25) {$1$}; \node at (-0.5,1.75) {$User_2$}; \node at (0.5,1.75) {$1$}; \node at (1.5,1.75) {$3$}; \node at (2.5,1.75) {$0$}; \node at (0.5,0.25) {$2$}; \node at (1.5,0.25) {$*$}; \node at (2.5,0.25) {$9$}; \draw (-1,0) grid[ystep=0.5] (3,3); \end{scope} \begin{scope}[every node/.append style={yslant=0.5},yslant=0.5] \shade[right color=colorside!70,left color=colorside!10] (3,-3) rectangle +(5,3); \node at (3.5,-0.25) {}; \node at (3.5,-0.75) {$user_1$}; \node at (3.5,-1.25) {$user_2$}; \node at (3.5,-1.75){$user_3$}; \node at (3.5,-2.25) {$...$}; \node at (3.5,-2.75) {$user_n$}; \node at (4.5,-0.25) {$item_1$}; \node at (4.5,-1.25) {$3$}; \node at (4.5,-0.75) {$*$}; \node at (4.5,-1.75) {$*$}; \node at (4.5,-2.25) {$...$}; \node at (4.5,-2.75) {$*$}; \node at (5.5,-0.25) {$item_2$}; \node at (5.5,-0.75) {$2$}; \node at (5.5,-1.75) {$3$}; \node at (5.5,-1.25) {$4$}; \node at (5.5,-2.75) {$5$}; \node at (5.5,-2.25) {$...$}; \node at (6.5,-0.25) {$...$}; \node at (6.5,-1.25) {$...$}; \node at (6.5,-2.25) {$...$}; \node at (6.5,-0.75) {$...$}; \node at (6.5,-1.75) {$...$}; \node at (6.5,-2.75) {$...$}; \node at (7.5,-0.25) {$item_n$}; \node at (7.5,-0.75) {$3$}; \node at (7.5,-1.25) {$5$}; \node at (7.5,-1.75) {$4$}; \node at (7.5,-2.25) {$...$}; \node at (7.5,-2.75) {$*$}; \draw (3,-3) grid[ystep=0.5] (8,0); \end{scope} \begin{scope}[every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-0.75 ] \shade[bottom color=colortop!10, top color=colortop!80] (8,4) rectangle +(-5,-4); \draw (3.0,0.0) grid[ystep=0.5] (8,4); \node at (3.5,3.75) {}; \node at (3.5,3.25) {$Legal$}; \node at (3.5,2.75) {$Fin.$}; \node at (3.5,2.25) {$Med.$}; \node at (3.5,1.75) {$Home$}; \node at (3.5,1.25) {$Road$}; \node at (3.5,0.75) {$Travel$}; \node at (3.5,0.25) {$Din.$}; \node at (4.5,3.75) {$item_1$}; \node at (4.5,3.25) {$1$}; \node at (4.5,2.75) {$0$}; \node at (4.5,2.25) {$0$}; \node at (4.5,1.75) {$1$}; \node at (4.5,1.25) {$1$}; \node at (4.5,0.75) {$0$}; \node at (4.5,0.25) {$1$}; \node at (5.5,3.75) {$item_2$}; \node at (5.5,3.25) {$1$}; \node at (5.5,2.75) {$0$}; \node at (5.5,2.25) {$0$}; \node at (5.5,1.75) {$1$}; \node at (5.5,1.25) {$0$}; \node at (5.5,0.75) {$1$}; \node at (5.5,0.25) {$1$}; \node at (6.5,3.75) {$...$}; \node at (6.5,3.25) {$...$}; \node at (6.5,2.75) {$...$}; \node at (6.5,2.25) {$...$}; \node at (6.5,1.75) {$...$}; \node at (6.5,1.25) {$...$}; \node at (6.5,0.75) {$...$}; \node at (6.5,0.25) {$...$}; \node at (7.5,3.75) {$item_n$}; \node at (7.5,3.25) {$0$}; \node at (7.5,2.75) {$1$}; \node at (7.5,2.25) {$1$}; \node at (7.5,1.75) {$0$}; \node at (7.5,1.25) {$0$}; \node at (7.5,0.75) {$1$}; \node at (7.5,0.25) {$0$}; \end{scope} \end{tikzpicture} \caption{User-Item Combined Matrix} \label{fig:com} \end{figure} \end{document}
\documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] %uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300 %Rounded Same Side Corner Rect [id:dp2451362198380881] \draw [fill={rgb, 255:red, 167; green, 189; blue, 216 } ,fill opacity=1 ] (79,54.17) .. controls (79,49.75) and (82.58,46.17) .. (87,46.17) -- (141,46.17) .. controls (145.42,46.17) and (149,49.75) .. (149,54.17) -- (149,86.17) .. controls (149,86.17) and (149,86.17) .. (149,86.17) -- (79,86.17) .. controls (79,86.17) and (79,86.17) .. (79,86.17) -- cycle ; %Straight Lines [id:da14573772274169616] \draw [line width=1.5] (114,47.37) -- (114,28.17) ; \draw [shift={(114,25.17)}, rotate = 450] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=1.5] [draw opacity=0] (11.61,-5.58) -- (0,0) -- (11.61,5.58) -- cycle ; %Straight Lines [id:da7579961352080994] \draw [line width=1.5] (114,109.37) -- (114,90.17) ; \draw [shift={(114,87.17)}, rotate = 450] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=1.5] [draw opacity=0] (11.61,-5.58) -- (0,0) -- (11.61,5.58) -- cycle ; %Rounded Same Side Corner Rect [id:dp27437364893503646] \draw [fill={rgb, 255:red, 236; green, 127; blue, 141 } ,fill opacity=1 ] (131,185.5) .. controls (131,181.08) and (134.58,177.5) .. (139,177.5) -- (193,177.5) .. controls (197.42,177.5) and (201,181.08) .. (201,185.5) -- (201,217.5) .. controls (201,217.5) and (201,217.5) .. (201,217.5) -- (131,217.5) .. controls (131,217.5) and (131,217.5) .. (131,217.5) -- cycle ; %Shape: Circle [id:dp6172800122901183] \draw (153.5,261.5) .. controls (153.5,254.6) and (159.1,249) .. (166,249) .. controls (172.9,249) and (178.5,254.6) .. (178.5,261.5) .. controls (178.5,268.4) and (172.9,274) .. (166,274) .. controls (159.1,274) and (153.5,268.4) .. (153.5,261.5) -- cycle ; %Straight Lines [id:da8111485597522028] \draw (67,129.5) -- (67,119.37) -- (167,119.5) -- (167,129.5) ; %Shape: Circle [id:dp5550396643085889] \draw (54.5,142.5) .. controls (54.5,135.6) and (60.1,130) .. (67,130) .. controls (73.9,130) and (79.5,135.6) .. (79.5,142.5) .. controls (79.5,149.4) and (73.9,155) .. (67,155) .. controls (60.1,155) and (54.5,149.4) .. (54.5,142.5) -- cycle ; %Straight Lines [id:da4358037156768244] \draw [line width=1.5] (167,177.7) -- (167,158.5) ; \draw [shift={(167,155.5)}, rotate = 450] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=1.5] [draw opacity=0] (11.61,-5.58) -- (0,0) -- (11.61,5.58) -- cycle ; %Straight Lines [id:da35373187835236874] \draw [line width=1.5] (114,109.37) -- (114,119.37) ; %Straight Lines [id:da1620841210006193] \draw [line width=1.5] (166,239.5) -- (166,220.3) ; \draw [shift={(166,217.3)}, rotate = 450] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=1.5] [draw opacity=0] (11.61,-5.58) -- (0,0) -- (11.61,5.58) -- cycle ; %Straight Lines [id:da9258346349543058] \draw [line width=1.5] (166,239.5) -- (166,249.5) ; % Text Node \draw (167,141.5) node {$G( z)$}; % Text Node \draw (181.5,119.5) node [scale=0.8,color={rgb, 255:red, 155; green, 155; blue, 155 } ,opacity=1 ] [align=left] {fake}; % Text Node \draw (52.5,118.5) node [scale=0.8,color={rgb, 255:red, 155; green, 155; blue, 155 } ,opacity=1 ] [align=left] {real}; % Text Node \draw (116,12.83) node [align=left] {real/fake}; % Text Node \draw (134.17,290) node [scale=0.8] [align=left] {a) Generative Adversarial Networks}; % Text Node \draw (67.5,139) node {$x$}; % Text Node \draw (168,259.5) node {$z$}; % Text Node \draw (166,197.5) node [scale=1.7280000000000002] [align=left] {G}; % Text Node \draw (114,66.17) node [scale=1.7280000000000002] [align=left] {D}; \end{tikzpicture} \end{document}
% https://texample.net/tikz/examples/swan-wave-model/ % Author: Marco Miani % SWAN (developed by SWAN group, TU Delft, The Netherlands) is a wave spectral numerical model. %For Simlating WAves Nearshore, it is necessary to define spatial grids of %physical dominant factors (wind friction, dissipation) as well as define a COMPUTATIONAL %grid on which the model performs its (spectral) calculations: budgeting energy spectra over %each cell of the (computational) grid. Grids might have different spatial resolution and extension. \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \pagestyle{empty} % Define the layers to draw the diagram \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \begin{tikzpicture}[scale=.9,every node/.style={minimum size=1cm},on grid] \begin{pgfonlayer}{background} % \draw [help lines, step=1,color=blue!15, very thin] (-6, 11) grid (10,-7); \end{pgfonlayer} \begin{pgfonlayer}{foreground} % % help guide lines % \draw [help lines,dashed] (0,-7) -- (0,11); % \draw [help lines,dashed] (-6,0) -- (10,0); % \node at (9,10) (zero) {(9,10)}; % \node at (6,6) (zero) {(6,6)}; % \node at (4,4) (zero) {(4,4)}; % \node at (-5,4) (zero) {(-5,4)}; % \node at (-5,1) (zero) {(-5,1)}; % \node at (-5,-2) (zero) {(-5,-2)}; % \node at (-5,-5) (zero) {(-5,-5)}; % \node at (7,-5) (zero) {(7,-5)}; % \node at (8,-7) (zero) {(8,-7)}; % \node at (0,-7) (zero) {(0,-7)}; \end{pgfonlayer} % Comp G %slanting: production of a set of n 'laminae' to be piled up. N=number of grids. \begin{scope}[ yshift=-83,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] % opacity to prevent graphical interference \fill[white,fill opacity=0.9] (0,0) rectangle (5,5); \draw[step=5mm, black] (0,0) grid (5,5); % defining grids \draw[step=1mm, red!50,thin] (3,1) grid (4,2); % Nested Grid \draw[black,very thick] (0,0) rectangle (5,5); % marking borders \fill[red] (0.05,0.05) rectangle (0.5,0.5); % Idem as above, for the n-th grid: % add some labels \begin{scope}[color=blue,font=\footnotesize] \node at (0,0) (a) {(0,0)}; \node at (5,5) (a) {(5,5)}; \node at (5,0) (a) {(5,0)}; \node at (0,5) (a) {(0,5)}; \end{scope} \end{scope} % Bathymetry up \begin{scope}[ yshift=0,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=.9] (0,0) rectangle (5,5); \draw[black,very thick] (0,0) rectangle (5,5); \draw[step=5mm, black] (0,0) grid (5,5); \end{scope} % Wind G % grid with internal 3x3 of step=10mm \begin{scope}[ yshift=90,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=.9] (0,0) rectangle (5,5); \draw[step=10mm, black] (1,1) grid (4,4); \draw[black,very thick] (1,1) rectangle (4,4); \draw[black,dashed] (0,0) rectangle (5,5); \node at (1,1) (a) {(1,1)}; \end{scope} % Friction G % grid with green subgrid of 2mm step \begin{scope}[ yshift=170,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] \fill[white,fill opacity=0.6] (0,0) rectangle (5,5); \draw[step=10mm, black] (2,2) grid (5,5); \draw[step=2mm, green] (2,2) grid (3,3); \draw[black,very thick] (2,2) rectangle (5,5); \draw[black,dashed] (0,0) rectangle (5,5); \node at (2,2) (a) {(2,2)}; \end{scope} % bottom grid \begin{scope}[ yshift=-170,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] %marking border \draw[black,very thick] (0,0) rectangle (5,5); %drawing corners (P1,P2, P3): only 3 points needed to define a plane. \draw [fill=lime](0,0) circle (.1) ; \draw [fill=lime](0,5) circle (.1); \draw [fill=lime](5,0) circle (.1); \draw [fill=lime](5,5) circle (.1); %drawing bathymetric hypotetic countours on the bottom grid: \draw [ultra thick](0,1) parabola bend (2,2) (5,1) ; \draw [dashed] (0,1.5) parabola bend (2.5,2.5) (5,1.5) ; \draw [dashed] (0,2) parabola bend (2.7,2.7) (5,2) ; \draw [dashed] (0,2.5) parabola bend (3.5,3.5) (5,2.5) ; \draw [dashed] (0,3.5) parabola bend (2.75,4.5) (5,3.5); \draw [dashed] (0,4) parabola bend (2.75,4.8) (5,4); \draw [dashed] (0,3) parabola bend (2.75,3.8) (5,3); \draw[-latex,thick](2.8,1) node[right]{$\mathsf{Shoreline}$} to[out=180,in=270] (2,1.99); \end{scope} %end of drawing grids % arrows %putting arrows and labels: \draw[-latex,thick] (6.2,2) node[right]{$\mathsf{Bathymetry (up)}$} to[out=180,in=90] (4,2); \draw[-latex,thick](5.8,-.3)node[right]{$\mathsf{Comp.\ G.}$} to[out=180,in=90] (3.9,-1); \draw[-latex,thick](5.9,5)node[right]{$\mathsf{Wind\ G.}$} to[out=180,in=90] (3.6,5); \draw[-latex,thick](5.9,8.4)node[right]{$\mathsf{Friction\ G.}$} to[out=180,in=90] (3.2,8); \draw[-latex,thick,red](5.3,-4.2)node[right]{$\mathsf{G. Cell}$} to[out=180,in=90] (0,-2.5); \draw[-latex,thick,red](4.3,-1.9)node[right]{$\mathsf{Nested\ G.}$} to[out=180,in=90] (2,-.5); \draw[-latex,thick](4,-6)node[right]{$\mathsf{Batymetry (dn)}$} to[out=180,in=90] (2,-5); \end{tikzpicture} \end{document}
\PassOptionsToPackage{table,dvipsnames,svgnames}{xcolor} \documentclass[tikz,margin=1cm]{standalone} \usetikzlibrary{arrows.meta,calc,positioning} \colorlet{A}{gray} \colorlet{B}{lightgray} \pgfdeclarelayer{background} \pgfdeclarelayer{timeline} \pgfdeclarelayer{period} \pgfdeclarelayer{foreground} \pgfsetlayers{background,timeline,period,main,foreground} %https://tex.stackexchange.com/a/349215 \tikzset{ timeline/.style={arrows={}}% ,timeline style/.style={timeline/.append style={#1}}% ,year label/.style={font=\Huge\sffamily\bfseries,below}% ,year label style/.style={year label/.append style={#1}}% ,year tick/.style={tick size=5pt}% ,year tick style/.style={year tick/.append style={#1}}% ,minor tick/.style={tick size=2pt, very thin}% ,minor tick style/.style={minor tick/.append style={#1}}% ,period/.style={solid,line width=\timelinewidth,line cap=square}% ,periodbox/.style={font=\Huge\sffamily\bfseries,text=black}% ,eventline/.style={draw,red,thick,line cap=round,line join=round}% ,eventbox/.style={rectangle,rounded corners=3pt,inner sep=3pt,fill=red!25!white,text width=3cm,anchor=west,text=black,align=left,font=\large}% ,tick size/.code={\def\ticksize{#1}}% ,labeled years step/.code={\def\yearlabelstep{#1}}% ,minor tick step/.code={\def\minortickstep{#1}}% ,year tick step/.code={\def\yeartickstep{#1}}% ,enlarge timeline/.code={\def\enlarge{#1}}% ,eventboxa/.style={eventbox,text width=#1,draw=A,fill=none}% ,eventboxb/.style={eventbox,text width=#1,draw=A,fill=none}% } % Still from %https://tex.stackexchange.com/a/349215 \newcommand*{\drawtimeline}[5][]{% \def\fromyear{#2}% \def\toyear{#3}% \def\timelinesize{#4}% \def\timelinewidth{#5}% \pgfmathsetmacro{\timelinesizept}{\timelinesize}% \pgfmathsetmacro{\timelinewidthpt}{\timelinewidth}% \pgfmathsetmacro{\timelineoffset}{\timelinewidth/2} \pgfmathsetmacro{\timelineoffsetpt}{\timelineoffset} % \begin{scope}[x=1pt, y=1pt, % Change main units to pt labeled years step=1,% Set some defaults minor tick step=0.25,% enlarge timeline=0cm,% year tick step=1,#1] \pgfmathsetmacro{\enlargept}{\enlarge} \pgfmathsetmacro{\yearticksep}{\timelinesize/((\toyear-\fromyear)/\yeartickstep)} \pgfmathsetmacro{\minorticksep}{\timelinesize/((\toyear-\fromyear)/\minortickstep)} \pgfmathsetmacro{\minorticklast}{\minorticksep/\minortickstep} \foreach \y[remember=\y as \lasty (initially 0), count=\i from \fromyear] in {0,\yearticksep,...,\timelinesizept}{ \coordinate (Y-\i) at (\y,0); \draw[year tick] (\y,-\ticksize/2) -- ++(0,\ticksize); \ifnum\i=\toyear\breakforeach\else \foreach \q[count=\j from 0] in {0,\minorticksep,...,\minorticklast}{ \coordinate (Y-\i-\j) at (\q+\y,0); \begin{pgfonlayer}{timeline} \draw[minor tick] (\q+\y,-\ticksize/2) -- ++(0,\ticksize); \end{pgfonlayer} };\fi};% \pgfmathsetmacro{\nextyear}{int(\fromyear+\yearlabelstep)} \begin{pgfonlayer}{timeline} \draw[timeline] (0,0) -- ++(-\enlargept,0) (0,0) -- ++(\timelinesizept,0) coordinate (end) -- ++(\enlargept,0);% Timeline \end{pgfonlayer} % \foreach \y in {\fromyear,\nextyear,...,\toyear} \node[year label] at (Y-\y) {\y}; \end{scope}% } % Put a period identifier midway between the start and end of the period % 1 = color of timeline segment % 2 = period start % 3 = period end % 4 = period text \newcommand{\period}[5]{\begin{pgfonlayer}{period} \draw[period,#1] (Y-#2) -- (Y-#3) node[periodbox,#5,midway,text=white] {\begin{tabular}{l} #4 \end{tabular}}; \end{pgfonlayer}} %This somewhat follows @cfr's Chronos. It was certainly inspired by Chronos. %https://tex.stackexchange.com/a/349236 % 1 = format of line and box % 2 = starting coordinate % 3 = pin associated with starting coordinate (well suited to using polar coordinate) % 4 = branch at top of pin (well suited to using polar coordinate) % 5 = Any extra formatting of node % 6 = Name of node % 7 = Node content \newcommand{\vevent}[7]{\begin{pgfonlayer}{timeline} \draw[eventline,#1](Y-#2) -- ++(#3) -- ++(#4) node[#5] (#6) {#7}; \end{pgfonlayer}} \begin{document} \begin{tikzpicture} \drawtimeline[ labeled years step=1, minor tick step=0.083333, timeline style={draw=gray,line width=\timelinewidthpt}, minor tick style={-,lightgray,tick size=3pt,line width=3pt,yshift=-\timelineoffsetpt}, ]% {2017}{2019}{50cm}{2cm}; % \period{A}{2017-0}{2017-2}{2017\\J-F}{} \period{B}{2017-2}{2017-4}{M-A}{} \period{A}{2017-4}{2017-6}{M-J}{} \period{B}{2017-6}{2017-8}{J-A}{} \period{A}{2017-8}{2017-10}{S-O}{} \period{B}{2017-10}{2017-12}{N-D}{} \period{A}{2018-0}{2018-2}{2018\\J-F}{} \period{B}{2018-2}{2018-4}{M-A}{} \period{A}{2018-4}{2018-6}{M-J}{} \period{B}{2018-6}{2018-8}{J-A}{} % \vevent{A}{2017-0}{90:2.5cm}{45:0.5cm}{eventboxa=5cm,anchor=west}{H}{Start of ZoW consortium\\10 Jan} \vevent{A}{2017-6}{-90:2.5cm}{-45:0.5cm}{eventboxa=4cm,anchor=west}{H}{1st Symposium\\8 Jun} \vevent{A}{2017-7}{90:2.5cm}{45:0.5cm}{eventboxa=4cm,anchor=west}{H}{1st Symposium\\8 Jun} \vevent{A}{2017-12}{-90:2.5cm}{-45:0.5cm}{eventboxa=4cm,anchor=west}{H}{2nd Symposium\\8 Jun} \vevent{A}{2018-0}{90:2.5cm}{45:0.5cm}{eventboxa=4cm,anchor=west}{H}{Storm\\Jan} \vevent{A}{2018-0}{90:4.5cm}{45:0.5cm}{eventboxa=4cm,anchor=west}{H}{Storm\\18 Jan} \vevent{A}{2018-6}{-90:2.5cm}{-45:0.5cm}{eventboxa=4cm,anchor=west}{H}{3rd Symposium\\14 Jun} % \node[draw=none,rectangle,fill=cyan,text width=10cm,minimum height=1cm,text=black,align=center,font=\Large] (AA) at ([yshift=-5cm]Y-2018-5) {Internship}; \node[below=0.5cm of AA,font=\large] {12 Feb - 10 Aug}; \end{tikzpicture} \end{document}
\documentclass[x11names]{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows,chains} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5mm}% %%%> \begin{comment} :Title: Easy-maintenance flowchart :Tags: flowcharts :Author: Brent Longborough :Slug: flexible-flow-chart This TikZ example illustrates a number of techniques for making TikZ flowcharts easier to maintain: * Use of <on chain> and <on grid> to simplify positioning * Use of global <node distance> options to eliminate the need to specify individual inter-node distances * Use of <join> to reduce the need for references to node names * Use of <join by> styles to tailor specific connectors * Use of <coordinate> nodes to provide consistent layout for parallel flow lines * A method for consistent annotation of decision box exits * A technique for marking coordinate nodes (for layout debugging) I encourage you to tinker at this file - add intermediate boxes, alter the global distance settings, and so on, to see how well (or ill!) it adapts. \end{comment} \begin{document} % ================================================= % Set up a few colours \colorlet{lcfree}{Green3} \colorlet{lcnorm}{Blue3} \colorlet{lccong}{Red3} % ------------------------------------------------- % Set up a new layer for the debugging marks, and make sure it is on % top \pgfdeclarelayer{marx} \pgfsetlayers{main,marx} % A macro for marking coordinates (specific to the coordinate naming % scheme used here). Swap the following 2 definitions to deactivate % marks. \providecommand{\cmark}[2][]{% \begin{pgfonlayer}{marx} \node [nmark] at (c#2#1) {#2}; \end{pgfonlayer}{marx} } \providecommand{\cmark}[2][]{\relax} % ------------------------------------------------- % Start the picture \begin{tikzpicture}[% >=triangle 60, % Nice arrows; your taste may be different start chain=going below, % General flow is top-to-bottom node distance=6mm and 60mm, % Global setup of box spacing every join/.style={norm}, % Default linetype for connecting boxes ] % ------------------------------------------------- % A few box styles % <on chain> *and* <on grid> reduce the need for manual relative % positioning of nodes \tikzset{ base/.style={draw, on chain, on grid, align=center, minimum height=4ex}, proc/.style={base, rectangle, text width=8em}, test/.style={base, diamond, aspect=2, text width=5em}, term/.style={proc, rounded corners}, % coord node style is used for placing corners of connecting lines coord/.style={coordinate, on chain, on grid, node distance=6mm and 25mm}, % nmark node style is used for coordinate debugging marks nmark/.style={draw, cyan, circle, font={\sffamily\bfseries}}, % ------------------------------------------------- % Connector line styles for different parts of the diagram norm/.style={->, draw, lcnorm}, free/.style={->, draw, lcfree}, cong/.style={->, draw, lccong}, it/.style={font={\small\itshape}} } % ------------------------------------------------- % Start by placing the nodes \node [proc, densely dotted, it] (p0) {New trigger message thread}; % Use join to connect a node to the previous one \node [term, join] {Trigger scheduler}; \node [proc, join] (p1) {Get quota $k > 1$}; \node [proc, join] {Open queue}; \node [proc, join] {Dispatch message}; \node [test, join] (t1) {Got msg?}; % No join for exits from test nodes - connections have more complex % requirements % We continue until all the blocks are positioned \node [proc] (p2) {$k \mathbin{{-}{=}} 1$}; \node [proc, join] (p3) {Dispatch message}; \node [test, join] (t2) {Got msg?}; \node [test] (t3) {Capacity?}; \node [test] (t4) {$k \mathbin{{-}{=}} 1$}; % We position the next block explicitly as the first block in the % second column. The chain 'comes along with us'. The distance % between columns has already been defined, so we don't need to % specify it. \node [proc, fill=lcfree!25, right=of p1] (p4) {Reset congestion}; \node [proc, join=by free] {Set \textsc{mq} wait flag}; \node [proc, join=by free] (p5) {Dispatch message}; \node [test, join=by free] (t5) {Got msg?}; \node [test] (t6) {Capacity?}; % Some more nodes specifically positioned (we could have avoided this, % but try it and you'll see the result is ugly). \node [test] (t7) [right=of t2] {$k \mathbin{{-}{=}} 1$}; \node [proc, fill=lccong!25, right=of t3] (p8) {Set congestion}; \node [proc, join=by cong, right=of t4] (p9) {Close queue}; \node [term, join] (p10) {Exit trigger message thread}; % ------------------------------------------------- % Now we place the coordinate nodes for the connectors with angles, or % with annotations. We also mark them for debugging. \node [coord, right=of t1] (c1) {}; \cmark{1} \node [coord, right=of t3] (c3) {}; \cmark{3} \node [coord, right=of t6] (c6) {}; \cmark{6} \node [coord, right=of t7] (c7) {}; \cmark{7} \node [coord, left=of t4] (c4) {}; \cmark{4} \node [coord, right=of t4] (c4r) {}; \cmark[r]{4} \node [coord, left=of t7] (c5) {}; \cmark{5} % ------------------------------------------------- % A couple of boxes have annotations \node [above=0mm of p4, it] {(Queue was empty)}; \node [above=0mm of p8, it] {(Queue was not empty)}; % ------------------------------------------------- % All the other connections come out of tests and need annotating % First, the straight north-south connections. In each case, we first % draw a path with a (consistently positioned) annotation node, then % we draw the arrow itself. \path (t1.south) to node [near start, xshift=1em] {$y$} (p2); \draw [*->,lcnorm] (t1.south) -- (p2); \path (t2.south) to node [near start, xshift=1em] {$y$} (t3); \draw [*->,lcnorm] (t2.south) -- (t3); \path (t3.south) to node [near start, xshift=1em] {$y$} (t4); \draw [*->,lcnorm] (t3.south) -- (t4); \path (t5.south) to node [near start, xshift=1em] {$y$} (t6); \draw [*->,lcfree] (t5.south) -- (t6); \path (t6.south) to node [near start, xshift=1em] {$y$} (t7); \draw [*->,lcfree] (t6.south) -- (t7); % ------------------------------------------------- % Now the straight east-west connections. To provide consistent % positioning of the test exit annotations, we have positioned % coordinates for the vertical part of the connectors. The annotation % text is positioned on a path to the coordinate, and then the whole % connector is drawn to its destination box. \path (t3.east) to node [near start, yshift=1em] {$n$} (c3); \draw [o->,lccong] (t3.east) -- (p8); \path (t4.east) to node [yshift=-1em] {$k \leq 0$} (c4r); \draw [o->,lcnorm] (t4.east) -- (p9); % ------------------------------------------------- % Finally, the twisty connectors. Again, we place the annotation % first, then draw the connector \path (t1.east) to node [near start, yshift=1em] {$n$} (c1); \draw [o->,lcfree] (t1.east) -- (c1) |- (p4); \path (t2.east) -| node [very near start, yshift=1em] {$n$} (c1); \draw [o->,lcfree] (t2.east) -| (c1); \path (t4.west) to node [yshift=-1em] {$k>0$} (c4); \draw [*->,lcnorm] (t4.west) -- (c4) |- (p3); \path (t5.east) -| node [very near start, yshift=1em] {$n$} (c6); \draw [o->,lcfree] (t5.east) -| (c6); \path (t6.east) to node [near start, yshift=1em] {$n$} (c6); \draw [o->,lcfree] (t6.east) -| (c7); \path (t7.east) to node [yshift=-1em] {$k \leq 0$} (c7); \draw [o->,lcfree] (t7.east) -- (c7) |- (p9); \path (t7.west) to node [yshift=-1em] {$k>0$} (c5); \draw [*->,lcfree] (t7.west) -- (c5) |- (p5); % ------------------------------------------------- % A last flourish which breaks all the rules \draw [->,MediumPurple4, dotted, thick, shorten >=1mm] (p9.south) -- ++(5mm,-3mm) -- ++(27mm,0) |- node [black, near end, yshift=0.75em, it] {(When message + resources available)} (p0); % ------------------------------------------------- \end{tikzpicture} % ================================================= \end{document}
\documentclass[parskip]{scrartcl} \usepackage[margin=15mm,landscape]{geometry} \usepackage{tikz} \usepackage{keyval} \usepackage{ifthen} \makeatletter % Standard Values for Parameters \newcommand{\tikzcuboid@shiftx}{0} \newcommand{\tikzcuboid@shifty}{0} \newcommand{\tikzcuboid@dimx}{4} \newcommand{\tikzcuboid@dimy}{4} \newcommand{\tikzcuboid@dimz}{4} \newcommand{\tikzcuboid@scale}{1} \newcommand{\tikzcuboid@densityx}{1} \newcommand{\tikzcuboid@densityy}{1} \newcommand{\tikzcuboid@densityz}{1} \newcommand{\tikzcuboid@rotation}{0} \newcommand{\tikzcuboid@anglex}{0} \newcommand{\tikzcuboid@angley}{90} \newcommand{\tikzcuboid@anglez}{225} \newcommand{\tikzcuboid@scalex}{1} \newcommand{\tikzcuboid@scaley}{1} \newcommand{\tikzcuboid@scalez}{1} \newcommand{\tikzcuboid@linefront}{} \newcommand{\tikzcuboid@linetop}{} \newcommand{\tikzcuboid@lineright}{} \newcommand{\tikzcuboid@fillfront}{} \newcommand{\tikzcuboid@filltop}{} \newcommand{\tikzcuboid@fillright}{} \newcommand{\tikzcuboid@newcoords}{N} \newcommand{\tikzcuboid@filled}{N} \newcommand{\tikzcuboid@shaded}{N} % Definition of Keys \define@key{tikzcuboid}{shiftx}[\tikzcuboid@shiftx]{\renewcommand{\tikzcuboid@shiftx}{#1}} \define@key{tikzcuboid}{shifty}[\tikzcuboid@shifty]{\renewcommand{\tikzcuboid@shifty}{#1}} \define@key{tikzcuboid}{dimx}[\tikzcuboid@dimx]{\renewcommand{\tikzcuboid@dimx}{#1}} \define@key{tikzcuboid}{dimy}[\tikzcuboid@dimy]{\renewcommand{\tikzcuboid@dimy}{#1}} \define@key{tikzcuboid}{dimz}[\tikzcuboid@dimz]{\renewcommand{\tikzcuboid@dimz}{#1}} \define@key{tikzcuboid}{scale}[\tikzcuboid@scale]{\renewcommand{\tikzcuboid@scale}{#1}} \define@key{tikzcuboid}{densityx}[\tikzcuboid@densityx]{\renewcommand{\tikzcuboid@densityx}{#1}} \define@key{tikzcuboid}{densityy}[\tikzcuboid@densityy]{\renewcommand{\tikzcuboid@densityy}{#1}} \define@key{tikzcuboid}{densityz}[\tikzcuboid@densityz]{\renewcommand{\tikzcuboid@densityz}{#1}} \define@key{tikzcuboid}{rotation}[\tikzcuboid@rotation]{\renewcommand{\tikzcuboid@rotation}{#1}} \define@key{tikzcuboid}{anglex}[\tikzcuboid@anglex]{\renewcommand{\tikzcuboid@anglex}{#1}} \define@key{tikzcuboid}{angley}[\tikzcuboid@angley]{\renewcommand{\tikzcuboid@angley}{#1}} \define@key{tikzcuboid}{anglez}[\tikzcuboid@anglez]{\renewcommand{\tikzcuboid@anglez}{#1}} \define@key{tikzcuboid}{scalex}[\tikzcuboid@scalex]{\renewcommand{\tikzcuboid@scalex}{#1}} \define@key{tikzcuboid}{scaley}[\tikzcuboid@scaley]{\renewcommand{\tikzcuboid@scaley}{#1}} \define@key{tikzcuboid}{scalez}[\tikzcuboid@scalez]{\renewcommand{\tikzcuboid@scalez}{#1}} \define@key{tikzcuboid}{linefront}[\tikzcuboid@linefront]{\renewcommand{\tikzcuboid@linefront}{#1}} \define@key{tikzcuboid}{linetop}[\tikzcuboid@linetop]{\renewcommand{\tikzcuboid@linetop}{#1}} \define@key{tikzcuboid}{lineright}[\tikzcuboid@lineright]{\renewcommand{\tikzcuboid@lineright}{#1}} \define@key{tikzcuboid}{fillfront}[\tikzcuboid@fillfront]{\renewcommand{\tikzcuboid@fillfront}{#1}} \define@key{tikzcuboid}{filltop}[\tikzcuboid@filltop]{\renewcommand{\tikzcuboid@filltop}{#1}} \define@key{tikzcuboid}{fillright}[\tikzcuboid@fillright]{\renewcommand{\tikzcuboid@fillright}{#1}} \define@key{tikzcuboid}{newcoords}[\tikzcuboid@newcoords]{\renewcommand{\tikzcuboid@newcoords}{#1}} \define@key{tikzcuboid}{filled}[\tikzcuboid@filled]{\renewcommand{\tikzcuboid@filled}{#1}} \define@key{tikzcuboid}{shaded}[\tikzcuboid@shaded]{\renewcommand{\tikzcuboid@shaded}{#1}} % Commands \newcommand{\tikzcuboid}[1]{ \setkeys{tikzcuboid}{#1} % Process Keys passed to command \begin{scope}[xshift=\tikzcuboid@shiftx,yshift=\tikzcuboid@shifty,scale=\tikzcuboid@scale,rotate=\tikzcuboid@rotation] \pgfmathsetmacro{\steppingx}{1/\tikzcuboid@densityx} \pgfmathsetmacro{\steppingy}{1/\tikzcuboid@densityy} \pgfmathsetmacro{\steppingz}{1/\tikzcuboid@densityz} \newcommand{\dimx}{\tikzcuboid@dimx} \newcommand{\dimy}{\tikzcuboid@dimy} \newcommand{\dimz}{\tikzcuboid@dimz} \pgfmathsetmacro{\secondx}{2*\steppingx} \pgfmathsetmacro{\secondy}{2*\steppingy} \pgfmathsetmacro{\secondz}{2*\steppingz} \foreach \x in {\steppingx,\secondx,...,\dimx} { \foreach \y in {\steppingy,\secondy,...,\dimy} { \pgfmathsetmacro{\lowx}{(\x-\steppingx)} \pgfmathsetmacro{\lowy}{(\y-\steppingy)} \filldraw[fill=orange,draw=blue] (\lowx,\lowy,\dimz) -- (\lowx,\y,\dimz) -- (\x,\y,\dimz) -- (\x,\lowy,\dimz) -- cycle; } } \foreach \x in {\steppingx,\secondx,...,\dimx} { \foreach \z in {\steppingz,\secondz,...,\dimz} { \pgfmathsetmacro{\lowx}{(\x-\steppingx)} \pgfmathsetmacro{\lowz}{(\z-\steppingz)} \filldraw[fill=green,draw=red] (\lowx,\dimy,\lowz) -- (\lowx,\dimy,\z) -- (\x,\dimy,\z) -- (\x,\dimy,\lowz) -- cycle; } } \foreach \y in {\steppingy,\secondy,...,\dimy} { \foreach \z in {\steppingz,\secondz,...,\dimz} { \pgfmathsetmacro{\lowy}{(\y-\steppingy)} \pgfmathsetmacro{\lowz}{(\z-\steppingz)} \filldraw[fill=red!50!blue,draw=yellow] (\dimx,\lowy,\lowz) -- (\dimx,\lowy,\z) -- (\dimx,\y,\z) -- (\dimx,\y,\lowz) -- cycle; } } \end{scope} % Write parameters to log file, just for checking % \typeout{=============================} % \typeout{*****************************} % \typeout{tikzcuboid shiftx = \tikzcuboid@shiftx} % \typeout{tikzcuboid shifty = \tikzcuboid@shifty} % \typeout{tikzcuboid dimx = \tikzcuboid@dimx} % \typeout{tikzcuboid dimy = \tikzcuboid@dimy} % \typeout{tikzcuboid dimz = \tikzcuboid@dimz} % \typeout{tikzcuboid scale = \tikzcuboid@scale} % \typeout{tikzcuboid densityx = \tikzcuboid@densityx} % \typeout{tikzcuboid densityy = \tikzcuboid@densityy} % \typeout{tikzcuboid densityz = \tikzcuboid@densityz} % \typeout{tikzcuboid rotation = \tikzcuboid@rotation} % \typeout{tikzcuboid anglex = \tikzcuboid@anglex} % \typeout{tikzcuboid angley = \tikzcuboid@angley} % \typeout{tikzcuboid anglez = \tikzcuboid@anglez} % \typeout{tikzcuboid scalex = \tikzcuboid@scalex} % \typeout{tikzcuboid scaley = \tikzcuboid@scaley} % \typeout{tikzcuboid scalez = \tikzcuboid@scalez} % \typeout{tikzcuboid linefront = \tikzcuboid@linefront} % \typeout{tikzcuboid linetop = \tikzcuboid@linetop} % \typeout{tikzcuboid lineright = \tikzcuboid@lineright} % \typeout{tikzcuboid fillfront = \tikzcuboid@fillfront} % \typeout{tikzcuboid filltop = \tikzcuboid@filltop} % \typeout{tikzcuboid fillright = \tikzcuboid@fillright} % \typeout{tikzcuboid newcoords = \tikzcuboid@newcoords} % \typeout{tikzcuboid filled = \tikzcuboid@filled} % \typeout{tikzcuboid shaded = \tikzcuboid@shaded} % \typeout{*****************************} % \typeout{=============================} } \makeatother \begin{document} \begin{tikzpicture} \tikzcuboid{shiftx=0cm,% shifty=0cm,% scale=1.00,% rotation=30,% densityx=1,% densityy=2,% densityz=3% } \tikzcuboid{% shiftx=0cm,% shifty=8cm,% scale=1.00,% rotation=60,% densityx=3,% densityy=2,% densityz=5% } \tikzcuboid{% shiftx=8cm,% shifty=8cm,% scale=1.00,% rotation=45,% densityx=0.5,% densityy=1,% densityz=2% } \tikzcuboid{% shiftx=8cm,% shifty=0cm,% scale=1.00,% rotation=75,% densityx=2,% densityy=7,% densityz=2% } \end{tikzpicture} \end{document}
\documentclass[10pt]{article} \usepackage{tikz} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% %%%> \begin{comment} :Title: Mammography problem from 'Intro to Bayes' :Tags: Nodes and Shapes;Node positioning;Text and math;Diagrams;Mathematics :Author: John Henderson :Slug: bayes The following was created in response to reading about "the mammography problem," a commonly used example illustrating the use of Bayesian Probability, on Eliezer Yudkowsky's page, "An Intuitive Explanation of Bayes' Theorem." The visualization presents the problem as involving "sieves" which behave differently depending on whether the individual passing through has or does not have cancer, illustrating the split probability created by the reliability of a mammography (chance of producing true positives and false positives). The illustration was posted on LessWrong.com, a site devoted to rationality, created by Yudkowsky. \end{comment} \usetikzlibrary{positioning,decorations.pathreplacing,shapes} \usepackage[english]{babel} \usepackage{microtype} \usepackage[hmargin=1.5cm,vmargin=1cm]{geometry} \usepackage{amsmath} \DeclareMathOperator{\p}{p} \newcommand*{\cancer}{\text{cancer}} \newcommand*{\testp}{\text{test}+} \begin{document} \begin{tikzpicture}[% % common options for blocks: block/.style = {draw, fill=blue!30, align=center, anchor=west, minimum height=0.65cm, inner sep=0}, % common options for the circles: ball/.style = {circle, draw, align=center, anchor=north, inner sep=0}] % circle illustrating all women \node[ball,text width=3cm,fill=purple!20] (all) at (6,0) {All women}; % two circles showing split of p{cancer} and p{~cancer} \node[ball,fill=red!70,text width=0.1cm,anchor=base] (pcan) at (3.5,-5.5) {}; \node[ball,fill=blue!40,text width=2.9cm,anchor=base] (pncan) at (8.5,-6) {Women without cancer\\ $\p({\sim}\cancer) = 99\%$}; % arrows showing split from all women to cancer and ~cancer \draw[->,thick,draw=red!50] (all.south) to [out=270,in=90] (pcan.north); \draw[->,thick,draw=blue!80] (all.south) to [out=270,in=110] (pncan.100); % transition from all women to actual cancer rates \node[anchor=north,text width=10cm,inner sep=.05cm,align=center,fill=white] (why1) at (6,-3.7) {In measuring, we find:}; % note illustration the p{cancer} circle (text won't fit inside) \node[inner sep=0,anchor=east,text width=3.3cm] (note1) at (3.2,-5.5) { Women with cancer $\p(\cancer) = 1\%$}; % draw the sieves \node[block,anchor=north,text width=4.4cm,fill=green!50] (tray1) at (3.5,-8.8) {\small{$\p(\testp\mid\cancer)=0.8$}}; \node[block,anchor=north,text width=4.4cm,fill=green!50] (tray2) at (8.5,-8.8) {$\p(\testp\mid{\sim}\cancer)=0.096$}; % text explaining how p{cancer} and p{~cancer} behave as they % pass through the sieves \node[anchor=west,text width=6cm] (note1) at (-6,-9.1) { Now we pass both groups through the sieve; note that both sieves are \emph{the same}; they just behave differently depending on which group is passing through. \\ Let $\testp=$ a positve mammography.}; % arrows showing the circles passing through the seives \draw[->,thick,draw=red!80] (3.5,-5.9) -- (3.5,-8.6); \draw[->,thick,draw=blue!50] (8.5,-8.1) -- (8.5,-8.6); % numerator \node[ball,text width=0.05cm,fill=red!70] (can) at (6,-10.5) {}; % dividing line \draw[thick] (5,-11) -- (7,-11); % demoniator \node[ball,text width=0.39cm,fill=blue!40,anchor=base] (ncan) at (6.5,-11.5) {}; \node[ball,text width=0.05cm,fill=red!70,anchor=base] (can2) at (5.5,-11.5) {}; % plus sign in denominator \draw[thick] (5.9,-11.4) -- (5.9,-11.6); \draw[thick] (5.8,-11.5) -- (6,-11.5); % arrows showing the output of the sieves formed the fraction \draw[->,thick,draw=red!80] (tray1.south) to [out=280,in=180] (can); \draw[->,thick,draw=red!80] (tray1.south) to [out=280,in=180] (can2); \node[anchor=north,inner sep=.1cm,align=center,fill=white] (why2) at (3.8,-9.8) {$1\% * 80\%$}; \draw[->,thick,draw=blue!50] (tray2.south) to [out=265,in=0] (ncan); \node[anchor=north,inner sep=.1cm,align=center,fill=white] (why2) at (8.4,-9.8) {$99\% * 9.6\%$}; % explanation of final formula \node[anchor=north west,text width=6.5cm] (note2) at (-6,-12.5) {Finally, to find the probability that a positive test \emph{actually means cancer}, we look at those who passed through the sieve \emph{with cancer}, and divide by all who received a positive test, cancer or not.}; % illustrated fraction turned into math \node[anchor=north,text width=10cm] (solution) at (6,-12.5) { \begin{align*} \frac{\p(\testp\mid\cancer)}{\p(\testp\mid\cancer) + \p(\testp\mid{\sim}\cancer)} &= \\ \frac{1\% * 80\%}{(1\% * 80\%) + (99\% * 9.6\%)} &= 7.8\% = \p(\cancer\mid\testp) \end{align*}}; \end{tikzpicture} \end{document}
% Author: Izaak Neutelings (June, 2017) % based on code from a friend \documentclass{article} \usepackage[top=0.25in]{geometry} \usepackage{amsmath} % for \dfrac \usepackage{tikz} \tikzset{>=latex} % for LaTeX arrow head \usepackage{pgfplots} % for the axis environment %% split figures into pages %\usepackage[active,tightpage]{preview} %\PreviewEnvironment{tikzpicture} %\setlength\PreviewBorder{1pt}% \pagestyle{empty} \begin{document} % DRAW PLOT: sin, cos, tan \begin{tikzpicture}[domain=-pi:pi,xscale=2/pi] % limits \def\xa{ -pi-0.3} \def\xb{3*pi+0.4} \def\ya{-3.4} \def\yb{ 3.6} \def\N{100} % number of points % axes & grid \draw[xstep=pi/2,very thin, color=gray] (\xa,\ya) grid (\xb,\yb); \draw[->] (\xa,0) -- (\xb,0) node[right] {$x$}; \draw[->] (0,\ya) -- (0,\yb) node[left] {$y$}; % ticks \draw[] % x node[below,scale=0.9] at ( -pi, 0) {$-\pi$} node[below,scale=0.9] at ( -pi/2, 0) {$-\dfrac{\pi}{2}$} node[below,scale=0.9] at ( pi, 0) {$\pi$} node[below,scale=0.9] at ( 0, 0) {0} node[below,scale=0.9] at ( pi/2, 0) {$\dfrac{\pi}{2}$} node[below,scale=0.9] at ( pi, 0) {$\pi$} node[below,scale=0.9] at (3*pi/2, 0) {$\dfrac{3\pi}{2}$} node[below,scale=0.9] at (2*pi, 0) {$2\pi$} node[below,scale=0.9] at (5*pi/2, 0) {$\dfrac{5\pi}{2}$} node[below,scale=0.9] at (3*pi, 0) {$3\pi$}; \draw[] % y node[left,scale=0.9] at ( 0, 3) {$3$} node[left,scale=0.9] at ( 0, 2) {$2$} node[left,scale=0.9] at ( 0, 1) {$1$} node[left,scale=0.9] at ( 0, 0) {$0$} node[left,scale=0.9] at ( 0, -1) {$-1$} node[left,scale=0.9] at ( 0, -2) {$-2$} node[left,scale=0.9] at ( 0, -3) {$-3$}; % functions \def\ea{0.28} \def\eb{0.26} \draw[color=blue,samples=\N,domain=\xa:\xb] % SIN plot(\x,{sin(\x r)}) % r for radians node[above right] at (5*pi/2,1) {$\sin(x)$}; \draw[color=red,samples=\N,domain=\xa:\xb] % COS plot(\x,{cos(\x r)}) node[above left] at (2*pi,1) {$\cos(x)$}; \draw[color=orange] % TAN plot[samples=\N,domain= \xa : -pi/2-\eb] (\x, {tan(\x r)}) plot[samples=\N,domain= -pi/2+\ea: pi/2-\eb] (\x, {tan(\x r)}) plot[samples=\N,domain= pi/2+\ea: 3*pi/2-\eb] (\x, {tan(\x r)}) plot[samples=\N,domain= 3*pi/2+\ea: 5*pi/2-\eb] (\x, {tan(\x r)}) plot[samples=\N,domain= 5*pi/2+\ea: \xb ] (\x, {tan(\x r)}) node[samples=\N,right=-2pt] at (pi/2,2.5) {$\tan(x)$}; \end{tikzpicture} \vspace{24pt} % AXIS ENVIRONMENT: sin, cos, tan \begin{tikzpicture} \begin{axis}[enlargelimits=false, axis lines=middle, scale=1.2, xtick={-3.15159, -1.57080, 0, 1.57080, 3.15159, 4.71239, 6.28318, 7.85398, 9.42478 }, xticklabels={$-\pi$, $-\frac{1}{2}\pi$, 0, $\frac{1}{2}\pi$, $\pi$, $\frac{3}{2}\pi$, $2\pi$, $\frac{5}{2}\pi$, $3\pi$ }, ytick={-3,-2,-1,0,1,2,3}, grid=major, % only a grid on the defined ticks samples=100 % number of points ] % sin \addplot[blue,no marks,domain=-1.2*pi:3*pi]{sin(deg(x))}; % deg to convert radians \node[right=10pt,above] at (axis cs:5*pi/2,1){\color{blue}$\sin(x)$}; % cos \addplot[red,no marks,domain=-1.2*pi:3*pi] {cos(deg(x))}; \node[above left] at (axis cs:2*pi,1){\color{red}$\cos(x)$}; % tan, multiple parts because of singularities \addplot[orange,no marks,domain=-1.2*pi:-0.583*pi, ]{tan(deg(x))}; \addplot[orange,no marks,domain=-0.4*pi:5*pi/12, ]{tan(deg(x))}; \addplot[orange,no marks,domain=27*pi/45:17*pi/12, ]{tan(deg(x))}; \addplot[orange,no marks,domain=1.6*pi:29*pi/12, ]{tan(deg(x))}; \addplot[orange,no marks,domain=2.6*pi:36*pi/12, ]{tan(deg(x))}; \node[right] at (axis cs:pi/2,2.5){\color{orange}$\tan(x)$}; \end{axis} \end{tikzpicture} \vspace{24pt} % AXIS ENVIRONMENT: arcsin, arccos, arctan \begin{tikzpicture} \begin{axis}[enlargelimits=false, axis lines=middle, xtick={-2,-1,0,1,2}, ytick={-1.570780, 1.570780, 3.14159}, yticklabels={$-\frac{1}{2}\pi$,$\frac{1}{2}\pi$,$\pi$}, grid=major, samples=100 ] % arcsin \addplot[domain=-1:1,no marks,blue] {rad(asin(x))}; \node at (axis cs:1.52,1.4){\color{blue}$\arcsin(x)$}; % arccos \addplot[domain=-1:1,no marks,red] {rad(acos(x))}; \node at (axis cs:-1.5,2.8){\color{red}$\arccos(x)$}; % arctan \addplot[domain=-2:2,no marks,orange] {rad(atan(x))}; \node at (axis cs:1.52,.67){\color{orange}$\arctan(x)$}; \end{axis} \end{tikzpicture} \end{document}
\documentclass[twoside,11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, latexsym} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{fadings} \begin{document} \begin{figure}[t!] \centering \begin{tikzpicture} \node at (0.5,-1){\begin{tabular}{c}input image\\layer $l = 0$\end{tabular}}; \draw (0,0) -- (1,0) -- (1,1) -- (0,1) -- (0,0); \node at (3,3.5){\begin{tabular}{c}convolutional layer\\with non-linearities\\layer $l = 1$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (2.75,1.25) -- (3.75,1.25) -- (3.75,2.25) -- (2.75,2.25) -- (2.75,1.25); \draw[fill=black,opacity=0.2,draw=black] (2.5,1) -- (3.5,1) -- (3.5,2) -- (2.5,2) -- (2.5,1); \draw[fill=black,opacity=0.2,draw=black] (2.25,0.75) -- (3.25,0.75) -- (3.25,1.75) -- (2.25,1.75) -- (2.25,0.75); \draw[fill=black,opacity=0.2,draw=black] (2,0.5) -- (3,0.5) -- (3,1.5) -- (2,1.5) -- (2,0.5); \draw[fill=black,opacity=0.2,draw=black] (1.75,0.25) -- (2.75,0.25) -- (2.75,1.25) -- (1.75,1.25) -- (1.75,0.25); \draw[fill=black,opacity=0.2,draw=black] (1.5,0) -- (2.5,0) -- (2.5,1) -- (1.5,1) -- (1.5,0); \node at (4.5,-1){\begin{tabular}{c}subsampling layer\\layer $l = 3$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (5,1.25) -- (5.75,1.25) -- (5.75,2) -- (5,2) -- (5,1.25); \draw[fill=black,opacity=0.2,draw=black] (4.75,1) -- (5.5,1) -- (5.5,1.75) -- (4.75,1.75) -- (4.75,1); \draw[fill=black,opacity=0.2,draw=black] (4.5,0.75) -- (5.25,0.75) -- (5.25,1.5) -- (4.5,1.5) -- (4.5,0.75); \draw[fill=black,opacity=0.2,draw=black] (4.25,0.5) -- (5,0.5) -- (5,1.25) -- (4.25,1.25) -- (4.25,0.5); \draw[fill=black,opacity=0.2,draw=black] (4,0.25) -- (4.75,0.25) -- (4.75,1) -- (4,1) -- (4,0.25); \draw[fill=black,opacity=0.2,draw=black] (3.75,0) -- (4.5,0) -- (4.5,0.75) -- (3.75,0.75) -- (3.75,0); \node at (7,3.5){\begin{tabular}{c}convolutional layer\\with non-linearities\\layer $l = 4$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (7.5,1.75) -- (8.25,1.75) -- (8.25,2.5) -- (7.5,2.5) -- (7.5,1.75); \draw[fill=black,opacity=0.2,draw=black] (7.25,1.5) -- (8,1.5) -- (8,2.25) -- (7.25,2.25) -- (7.25,1.5); \draw[fill=black,opacity=0.2,draw=black] (7,1.25) -- (7.75,1.25) -- (7.75,2) -- (7,2) -- (7,1.25); \draw[fill=black,opacity=0.2,draw=black] (6.75,1) -- (7.5,1) -- (7.5,1.75) -- (6.75,1.75) -- (6.75,1); \draw[fill=black,opacity=0.2,draw=black] (6.5,0.75) -- (7.25,0.75) -- (7.25,1.5) -- (6.5,1.5) -- (6.5,0.75); \draw[fill=black,opacity=0.2,draw=black] (6.25,0.5) -- (7,0.5) -- (7,1.25) -- (6.25,1.25) -- (6.25,0.5); \draw[fill=black,opacity=0.2,draw=black] (6,0.25) -- (6.75,0.25) -- (6.75,1) -- (6,1) -- (6,0.25); \draw[fill=black,opacity=0.2,draw=black] (5.75,0) -- (6.5,0) -- (6.5,0.75) -- (5.75,0.75) -- (5.75,0); \node at (9.5,-1){\begin{tabular}{c}subsampling layer\\layer $l = 6$\end{tabular}}; \draw[fill=black,opacity=0.2,draw=black] (10,1.75) -- (10.5,1.75) -- (10.5,2.25) -- (10,2.25) -- (10,1.75); \draw[fill=black,opacity=0.2,draw=black] (9.75,1.5) -- (10.25,1.5) -- (10.25,2) -- (9.75,2) -- (9.75,1.5); \draw[fill=black,opacity=0.2,draw=black] (9.5,1.25) -- (10,1.25) -- (10,1.75) -- (9.5,1.75) -- (9.5,1.25); \draw[fill=black,opacity=0.2,draw=black] (9.25,1) -- (9.75,1) -- (9.75,1.5) -- (9.25,1.5) -- (9.25,1); \draw[fill=black,opacity=0.2,draw=black] (9,0.75) -- (9.5,0.75) -- (9.5,1.25) -- (9,1.25) -- (9,0.75); \draw[fill=black,opacity=0.2,draw=black] (8.75,0.5) -- (9.25,0.5) -- (9.25,1) -- (8.75,1) -- (8.75,0.5); \draw[fill=black,opacity=0.2,draw=black] (8.5,0.25) -- (9,0.25) -- (9,0.75) -- (8.5,0.75) -- (8.5,0.25); \draw[fill=black,opacity=0.2,draw=black] (8.25,0) -- (8.75,0) -- (8.75,0.5) -- (8.25,0.5) -- (8.25,0); \node at (12,3.5){\begin{tabular}{c}fully connected layer\\layer $l = 7$\end{tabular}}; \draw[fill=black,draw=black,opacity=0.5] (10.5,0) -- (11,0) -- (12.5,1.75) -- (12,1.75) -- (10.5,0); \node at (13,-1){\begin{tabular}{c}fully connected layer\\output layer $l = 8$\end{tabular}}; \draw[fill=black,draw=black,opacity=0.5] (12.5,0.5) -- (13,0.5) -- (13.65,1.25) -- (13.15,1.25) -- (12.5,0.5); \end{tikzpicture} \caption[Architecture of a traditional convolutional neural network.]{The architecture of the original convolutional neural network, as introduced by LeCun et al. (1989), alternates between convolutional layers including hyperbolic tangent non-linearities and subsampling layers. In this illustration, the convolutional layers already include non-linearities and, thus, a convolutional layer actually represents two layers. The feature maps of the final subsampling layer are then fed into the actual classifier consisting of an arbitrary number of fully connected layers. The output layer usually uses softmax activation functions.} \label{fig:traditional-convolutional-network} \end{figure} \end{document}
\documentclass[parskip]{scrartcl} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \tikzset{ vertex/.style={ circle, minimum size=20pt, inner sep=0pt, fill=gray!10}, axial/.style={ rectangle, minimum size=20pt, inner sep=0pt, fill=gray!30}, edge/.style={draw,thick,-,black}, rotu/.style={midway}, sinal/.style={draw, circle, inner sep=0pt, thin} } \def\dist{0.4} \begin{tikzpicture}[ scale=2, ->, thick, z={(0.45,0.35)}, node distance=0.65cm] \node[vertex] (v0) at (0,0,0) {$(1)$}; \node[vertex] (v1) at (0,1,0) {$b$}; \node[vertex] (v2) at (1,0,0) {$a$}; \node[vertex] (v3) at (1,1,0) {$ab$}; \node[vertex] (v4) at (0,0,1) {$c$}; \node[vertex] (v5) at (0,1,1) {$bc$}; \node[vertex] (v6) at (1,0,1) {$ac$}; \node[vertex] (v7) at (1,1,1) {$abc$}; \draw[edge] (v0) -- (v1) node[rotu, left=\dist] {$B$} -- (v3) -- (v2) -- (v0) node[rotu, below=\dist] {$A$}; \draw[edge] (v0) -- (v4) -- (v5) -- (v1); \draw[edge] (v2) -- (v6) node[rotu, below right=\dist] {$C$} -- (v7) -- (v3); \draw[edge] (v4) -- (v6); \draw[edge] (v5) -- (v7); \node[sinal, below of=v0] {$-$}; \node[sinal, left of=v0] {$-$}; \node[sinal, left of=v1] {$+$}; \node[sinal, below of=v2] {$+$}; \node[sinal, right of=v3] {$-$}; \node[sinal, right of=v7] {$+$}; \end{tikzpicture} \def\dist{0.4} \def\ax{2} \begin{tikzpicture}[ scale=2, ->, thick, z={(0.55,0.3)}, node distance=0.65cm] \node[vertex, fill=yellow] (c0) at (0,0,0) {$0$}; \node[vertex] (v0) at (-1,-1,-1) {$(1)$}; \node[vertex] (v1) at (-1,1,-1) {$b$}; \node[vertex] (v2) at (1,-1,-1) {$a$}; \node[vertex] (v3) at (1,1,-1) {$ab$}; \node[vertex] (v4) at (-1,-1,1) {$c$}; \node[vertex] (v5) at (-1,1,1) {$bc$}; \node[vertex] (v6) at (1,-1,1) {$ac$}; \node[vertex] (v7) at (1,1,1) {$abc$}; \node[axial] (a1) at (-\ax,0,0) {$W$}; \node[axial] (a2) at (\ax,0,0) {$W$}; \node[axial] (a3) at (0,-\ax,0) {$W$}; \node[axial] (a4) at (0,\ax,0) {$W$}; \node[axial] (a5) at (0,0,-\ax) {$W$}; \node[axial] (a6) at (0,0,\ax) {$W$}; \draw[edge] (v0) -- (v1) node[rotu, left=\dist] {$B$} -- (v3) -- (v2) -- (v0) node[rotu, below=\dist] {$A$}; \draw[edge] (v0) -- (v4) -- (v5) -- (v1); \draw[edge] (v2) -- (v6) node[rotu, below right=\dist] {$C$} -- (v7) -- (v3); \draw[edge] (v4) -- (v6); \draw[edge] (v5) -- (v7); \draw[edge] (a1) -- (c0) --(a2); \draw[edge] (a3) -- (c0) --(a4); \draw[edge] (a5) -- (c0) --(a6); \node[sinal, below of=v0] {$-$}; \node[sinal, left of=v0] {$-$}; \node[sinal, left of=v1] {$+$}; \node[sinal, below of=v2] {$+$}; \node[sinal, right of=v3] {$-$}; \node[sinal, right of=v7] {$+$}; \end{tikzpicture} \begin{tikzpicture}[ scale=2, ->, thick, z={(0.45,0.35)}, node distance=0.65cm, vertex/.style={ rectangle, minimum size=12pt, inner sep=1pt, fill=gray!10 }] \node[text centered] (title) at (0.7,1.7,0) {Rendimento (\%) em um $2^3$}; \node[vertex] (v0) at (0,0,0) {$54.8$}; \node[vertex] (v1) at (0,1,0) {$48.0$}; \node[vertex] (v2) at (1,0,0) {$86.5$}; \node[vertex] (v3) at (1,1,0) {$63.0$}; \node[vertex] (v4) at (0,0,1) {$63.0$}; \node[vertex] (v5) at (0,1,1) {$58.5$}; \node[vertex] (v6) at (1,0,1) {$93.5$}; \node[vertex] (v7) at (1,1,1) {$72.0$}; \draw[edge] (v0) -- (v1) node[rotu, rotate=90, yshift=1.2cm] {Catalizador} -- (v3) -- (v2) -- (v0) node[rotu, below=0.9cm] {Temperatura}; \draw[edge] (v0) -- (v4) -- (v5) -- (v1); \draw[edge] (v2) -- (v6) node[rotu, rotate=40, yshift=-1cm, xshift=0.5cm] {Concentra\c{c}\~ao} -- (v7) -- (v3); \draw[edge] (v4) -- (v6); \draw[edge] (v5) -- (v7); \node[sinal, below of=v0] {$-$}; \node[sinal, left of=v0] {$-$}; \node[sinal, left of=v1] {$+$}; \node[sinal, below of=v2] {$+$}; \node[sinal, right of=v3] {$-$}; \node[sinal, right of=v7] {$+$}; \end{tikzpicture} \end{document}
\documentclass[border=5pt]{standalone} \usepackage{xcolor} \definecolor{ocre}{HTML}{800000} \definecolor{sky}{HTML}{C6D9F1} \definecolor{skybox}{HTML}{5F86B3} \usepackage{tikz} \usepackage{pgfmath} \usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings} \renewcommand*\familydefault{\sfdefault} % Set font to serif family % arctext from Andrew code with modifications: %Variables: 1: ID, 2:Style 3:box height 4: Radious 5:start-angl 6:end-angl 7:text {format along path} \def\arctext[#1][#2][#3](#4)(#5)(#6)#7{ \draw[#2] (#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3) -- (#6:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1) arc (#6:#5:#4cm-#3) coordinate (below #1) -- (#5:#4) coordinate (left #1) -- cycle; \def\a#1{#4cm+#3} \def\b#1{#4cm-#3} \path[ decoration={ raise = -0.5ex, % Controls relavite text height position. text along path, text = {#7}, text align = center, }, decorate ] (#5:#4) arc (#5:#6:#4); } % arcarrow, this is mine, for beerware purpose... % Function: Draw an arrow from arctex coordinate specific nodes to another % Arrow start at the start of arctext box and could be shifted to change the position % to avoid go over another box. % Var: 1:Start coordinate 2:End coordinate 3:angle to shift from acrtext box \def\arcarrow(#1)(#2)[#3]{ \draw[very thick,->,>=latex,black!60] let \p1 = (#1), \p2 = (#2), % To access cartesian coordinates x, and y. \n1 = {veclen(\x1,\y1)}, % Distance from the origin \n2 = {veclen(\x2,\y2)}, % Distance from the origin \n3 = {atan2(\y1,\x1)} % Angle where acrtext starts. in (\n3-#3: \n1) -- (\n3-#3: \n2); % Draw the arrow. } \begin{document} \begin{tikzpicture}[ % Environment Cfg font=\sf \scriptsize, % Styles myarrow/.style={ very thick, -latex, black!60, }, Center/.style ={ circle, fill=ocre, text=white, align=center, font =\footnotesize\bf, inner sep=1pt, }, RedArc/.style ={ color=black, thick, fill=ocre, blur shadow, }, SkyArc/.style ={ color=skybox, thick, fill=sky, blur shadow, }, ] % Drawing the center for AI \node[Center](AI) at (0,0) { Computational \\ Intelligence \\(AI)\\ Agent}; \coordinate (AROUND) at (0:1.2); % Drawing the Text Arcs % Format: \Arctext[ID][box-style][box-height](radious)(start-angl)(end-angl){|text-styles| Text} % Machine Learning \arctext[ML][RedArc][8pt](2.75)(135)(85){|\footnotesize\bf\color{white}| Machine Learning}; \arctext[REIN][SkyArc][5pt](3.50)(135)(85){|\scriptsize\color{black}| Decision Trees}; \arctext[KNOW][SkyArc][5pt](4.00)(135)(85){|\scriptsize| Neural Networks}; % \arctext[SUPL][SkyArc][5pt](4.00)(140)(115){|\scriptsize| Supervised L.}; \arctext[PROB][SkyArc][5pt](4.50)(135)(85){|\scriptsize\color{black}| Explanation Based Learning}; % Problem Solving \arctext[SOLV][RedArc][8pt](2.75)(80)(40){|\footnotesize\bf\color{white}| Searching}; \arctext[SRCH][SkyArc][5pt](3.50)(80)(40){|\scriptsize\color{black}| Graph Searching }; \arctext[HEUR][SkyArc][5pt](4.00)(80)(40){|\scriptsize| Heuristic Search}; \arctext[CONST][SkyArc][5pt](4.50)(80)(40){|\scriptsize\color{black}| Constraint Satisfaction}; % Natural Language Processing \arctext[NLP][RedArc][8pt](2.75)(35)(-20){|\footnotesize\bf\color{white}| Definite Knowledge}; \arctext[TRAN][SkyArc][5pt](3.50)(35)(5){|\scriptsize\color{black}| Recursion}; \arctext[TRAN][SkyArc][5pt](3.50)(0)(-20){|\scriptsize\color{black}| NLP}; \arctext[SPER][SkyArc][5pt](4.00)(35)(-20){|\scriptsize| Grammar Augmentation}; \arctext[INFX][SkyArc][5pt](4.50)(35)(-20){|\scriptsize\color{black}| First Order Predicate Calculus}; % Decision Making \arctext[DEC][RedArc][8pt](2.75)(290)(335){|\footnotesize\bf\color{white}| Planning}; \arctext[LOG][SkyArc][5pt](3.50)(290)(335){|\scriptsize\color{black}| Time Representation}; \arctext[KNOW][SkyArc][5pt](4.00)(290)(335){|\scriptsize| World Representations}; \arctext[PLAN][SkyArc][5pt](4.50)(290)(335){|\scriptsize| Forward Planning}; % Reasoning \arctext[REAS][RedArc][8pt](2.75)(250)(285){|\footnotesize\bf\color{white}| Reasoning}; \arctext[PROB][SkyArc][5pt](3.50)(250)(285){|\scriptsize\color{black}| Semantics}; \arctext[REAT][SkyArc][5pt](4.00)(249)(287){|\scriptsize| Symbolic Representation}; \arctext[UNQU][SkyArc][5pt](4.50)(248)(287){|\scriptsize\color{black}| Clauses, Questions, Answers}; % Robotics \arctext[ROB][RedArc][8pt](2.75)(200)(245){|\footnotesize\bf\color{white}| Robotics}; \arctext[RPER][SkyArc][5pt](3.50)(200)(245){|\scriptsize\color{black}| Agent Functions}; \arctext[RACT][SkyArc][5pt](4.00)(200)(245){|\scriptsize| Robotic Systems}; \arctext[MAPL][SkyArc][5pt](4.50)(200)(224){|\scriptsize\color{black}| Agent Models}; \arctext[MAPL][SkyArc][5pt](4.50)(226)(245){|\scriptsize\color{black}| Architecture}; % Object Recognition \arctext[RECO][RedArc][8pt](2.75)(140)(195){|\footnotesize\bf\color{white}| Knowledge}; \arctext[VIS][SkyArc][5pt](3.50)(140)(195){|\scriptsize\color{black}| Representation Language}; \arctext[IMGP][SkyArc][5pt](4.00)(140)(195){|\scriptsize\color{black}| Map Problem to Representation }; \arctext[MOTC][SkyArc][5pt](4.50)(140)(195){|\scriptsize\color{black}| Knowledge Based Systems}; % %ADITIONAL EXTERNAL ARC % \arctext[NEW][ % color=white, % shade, % upper left=gray, % upper right=black!50, % lower left=gray, % lower right=gray!50, % rounded corners = 8pt % ][8pt](5.2)(180)(0){|\footnotesize\bf\color{white}| "Computational Intelligence: A Logical Approach" by David Poole, Alan Mackworth and Randy Goebel}; % Drawing the Arrows from contributing branch to AI % Format: \arcarrow(above/below ID)(abobe/below ID)[shift] \arcarrow(below ML)(AROUND)[30]; \arcarrow(below SOLV)(AROUND)[24]; \arcarrow(below NLP)(AROUND)[15]; \arcarrow(below DEC)(AROUND)[-25]; \arcarrow(below REAS)(AROUND)[-17]; \arcarrow(below ROB)(AROUND)[-19]; \arcarrow(below RECO)(AROUND)[-33]; % Same level Arrows. Not needed now % \draw[myarrow] (left SSNX) -- (right DUAM); % \draw[myarrow] (left ML) -- (left SRel); % \draw[myarrow] (left SCap) -- (right ML); % Color Legend and labels \draw [myarrow] (-5,-5) coordinate (legend) -- ++(.8,0) node[anchor=west] {(contribution)}; \draw [RedArc] (legend)++(0,-0.4) rectangle ++(.8,-.3)++(0,.2) node [anchor=west, text width=3em] {capabilities,\\disciplines}; \draw [SkyArc] (legend)++(0,-1) rectangle ++(.8,-.3)++(0,.2) node[anchor=west, color=black] {subfield}; % source, book and authors \node [text width=6.45cm] at (1,-5.6) {Source: \textit {"Computational Intelligence: A Logical Approach"} \\by David Poole, Alan Mackworth and Randy Goebel}; % copyright \node [text width=3cm] at (3.25,-6.25) {\begin{tiny}Copyright \textcopyright Alfonso R. Reyes, 2020\end{tiny}}; \end{tikzpicture} \end{document}
\documentclass[a4paper,10pt]{article} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[ansinew]{inputenc} \usepackage{lmodern} % font definition \usepackage{amsmath} % math fonts \usepackage{amsthm} \usepackage{amsfonts} \usepackage{tikz} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% %%%> \begin{comment} :Title: Kalman Filter System Model :Slug: kalman-filter :Author: Burkart Lingner This is the system model of the (linear) Kalman filter. \end{comment} \usetikzlibrary{decorations.pathmorphing} % noisy shapes \usetikzlibrary{fit} % fitting shapes to coordinates \usetikzlibrary{backgrounds} % drawing the background after the foreground \begin{document} \begin{figure}[htbp] \centering % The state vector is represented by a blue circle. % "minimum size" makes sure all circles have the same size % independently of their contents. \tikzstyle{state}=[circle, thick, minimum size=1.2cm, draw=blue!80, fill=blue!20] % The measurement vector is represented by an orange circle. \tikzstyle{measurement}=[circle, thick, minimum size=1.2cm, draw=orange!80, fill=orange!25] % The control input vector is represented by a purple circle. \tikzstyle{input}=[circle, thick, minimum size=1.2cm, draw=purple!80, fill=purple!20] % The input, state transition, and measurement matrices % are represented by gray squares. % They have a smaller minimal size for aesthetic reasons. \tikzstyle{matrx}=[rectangle, thick, minimum size=1cm, draw=gray!80, fill=gray!20] % The system and measurement noise are represented by yellow % circles with a "noisy" uneven circumference. % This requires the TikZ library "decorations.pathmorphing". \tikzstyle{noise}=[circle, thick, minimum size=1.2cm, draw=yellow!85!black, fill=yellow!40, decorate, decoration={random steps, segment length=2pt, amplitude=2pt}] % Everything is drawn on underlying gray rectangles with % rounded corners. \tikzstyle{background}=[rectangle, fill=gray!10, inner sep=0.2cm, rounded corners=5mm] \begin{tikzpicture}[>=latex,text height=1.5ex,text depth=0.25ex] % "text height" and "text depth" are required to vertically % align the labels with and without indices. % The various elements are conveniently placed using a matrix: \matrix[row sep=0.5cm,column sep=0.5cm] { % First line: Control input & \node (u_k-1) [input]{$\mathbf{u}_{k-1}$}; & & \node (u_k) [input]{$\mathbf{u}_k$}; & & \node (u_k+1) [input]{$\mathbf{u}_{k+1}$}; & \\ % Second line: System noise & input matrix \node (w_k-1) [noise] {$\mathbf{w}_{k-1}$}; & \node (B_k-1) [matrx] {$\mathbf{B}$}; & \node (w_k) [noise] {$\mathbf{w}_k$}; & \node (B_k) [matrx] {$\mathbf{B}$}; & \node (w_k+1) [noise] {$\mathbf{w}_{k+1}$}; & \node (B_k+1) [matrx] {$\mathbf{B}$}; & \\ % Third line: State & state transition matrix \node (A_k-2) {$\cdots$}; & \node (x_k-1) [state] {$\mathbf{x}_{k-1}$}; & \node (A_k-1) [matrx] {$\mathbf{A}$}; & \node (x_k) [state] {$\mathbf{x}_k$}; & \node (A_k) [matrx] {$\mathbf{A}$}; & \node (x_k+1) [state] {$\mathbf{x}_{k+1}$}; & \node (A_k+1) {$\cdots$}; \\ % Fourth line: Measurement noise & measurement matrix \node (v_k-1) [noise] {$\mathbf{v}_{k-1}$}; & \node (H_k-1) [matrx] {$\mathbf{H}$}; & \node (v_k) [noise] {$\mathbf{v}_k$}; & \node (H_k) [matrx] {$\mathbf{H}$}; & \node (v_k+1) [noise] {$\mathbf{v}_{k+1}$}; & \node (H_k+1) [matrx] {$\mathbf{H}$}; & \\ % Fifth line: Measurement & \node (z_k-1) [measurement] {$\mathbf{z}_{k-1}$}; & & \node (z_k) [measurement] {$\mathbf{z}_k$}; & & \node (z_k+1) [measurement] {$\mathbf{z}_{k+1}$}; & \\ }; % The diagram elements are now connected through arrows: \path[->] (A_k-2) edge[thick] (x_k-1) % The main path between the (x_k-1) edge[thick] (A_k-1) % states via the state (A_k-1) edge[thick] (x_k) % transition matrices is (x_k) edge[thick] (A_k) % accentuated. (A_k) edge[thick] (x_k+1) % x -> A -> x -> A -> ... (x_k+1) edge[thick] (A_k+1) (x_k-1) edge (H_k-1) % Output path x -> H -> z (H_k-1) edge (z_k-1) (x_k) edge (H_k) (H_k) edge (z_k) (x_k+1) edge (H_k+1) (H_k+1) edge (z_k+1) (v_k-1) edge (z_k-1) % Output noise v -> z (v_k) edge (z_k) (v_k+1) edge (z_k+1) (w_k-1) edge (x_k-1) % System noise w -> x (w_k) edge (x_k) (w_k+1) edge (x_k+1) (u_k-1) edge (B_k-1) % Input path u -> B -> x (B_k-1) edge (x_k-1) (u_k) edge (B_k) (B_k) edge (x_k) (u_k+1) edge (B_k+1) (B_k+1) edge (x_k+1) ; % Now that the diagram has been drawn, background rectangles % can be fitted to its elements. This requires the TikZ % libraries "fit" and "background". % Control input and measurement are labeled. These labels have % not been translated to English as "Measurement" instead of % "Messung" would not look good due to it being too long a word. \begin{pgfonlayer}{background} \node [background, fit=(u_k-1) (u_k+1), label=left:Entrance:] {}; \node [background, fit=(w_k-1) (v_k-1) (A_k+1)] {}; \node [background, fit=(z_k-1) (z_k+1), label=left:Measure:] {}; \end{pgfonlayer} \end{tikzpicture} \caption{Kalman filter system model} \end{figure} This is the system model of the (linear) Kalman filter. At each time step the state vector $\mathbf{x}_k$ is propagated to the new state estimation $\mathbf{x}_{k+1}$ by multiplication with the constant state transition matrix $\mathbf{A}$. The state vector $\mathbf{x}_{k+1}$ is additionally influenced by the control input vector $\mathbf{u}_{k+1}$ multiplied by the input matrix $\mathbf{B}$, and the system noise vector $\mathbf{w}_{k+1}$. The system state cannot be measured directly. The measurement vector $\mathbf{z}_k$ consists of the information contained within the state vector $\mathbf{x}_k$ multiplied by the measurement matrix $\mathbf{H}$, and the additional measurement noise $\mathbf{v}_k$. \end{document}
\documentclass[parskip]{scrartcl} \usepackage[margin=10mm,landscape]{geometry} \usepackage{tikz} \newif\ifcuboidshade \newif\ifcuboidemphedge \tikzset{ cuboid/.is family, cuboid, shiftx/.initial=0, shifty/.initial=0, dimx/.initial=3, dimy/.initial=3, dimz/.initial=3, scale/.initial=1, densityx/.initial=1, densityy/.initial=1, densityz/.initial=1, rotation/.initial=0, anglex/.initial=0, angley/.initial=90, anglez/.initial=225, scalex/.initial=1, scaley/.initial=1, scalez/.initial=0.5, front/.style={draw=black,fill=white}, top/.style={draw=black,fill=white}, right/.style={draw=black,fill=white}, shade/.is if=cuboidshade, shadecolordark/.initial=black, shadecolorlight/.initial=white, shadeopacity/.initial=0.15, shadesamples/.initial=16, emphedge/.is if=cuboidemphedge, emphstyle/.style={thick}, } \newcommand{\tikzcuboidkey}[1]{\pgfkeysvalueof{/tikz/cuboid/#1}} % Commands \newcommand{\tikzcuboid}[1]{ \tikzset{cuboid,#1} % Process Keys passed to command \pgfmathsetlengthmacro{\vectorxx}{\tikzcuboidkey{scalex}*cos(\tikzcuboidkey{anglex})*28.452756} \pgfmathsetlengthmacro{\vectorxy}{\tikzcuboidkey{scalex}*sin(\tikzcuboidkey{anglex})*28.452756} \pgfmathsetlengthmacro{\vectoryx}{\tikzcuboidkey{scaley}*cos(\tikzcuboidkey{angley})*28.452756} \pgfmathsetlengthmacro{\vectoryy}{\tikzcuboidkey{scaley}*sin(\tikzcuboidkey{angley})*28.452756} \pgfmathsetlengthmacro{\vectorzx}{\tikzcuboidkey{scalez}*cos(\tikzcuboidkey{anglez})*28.452756} \pgfmathsetlengthmacro{\vectorzy}{\tikzcuboidkey{scalez}*sin(\tikzcuboidkey{anglez})*28.452756} \begin{scope}[xshift=\tikzcuboidkey{shiftx}, yshift=\tikzcuboidkey{shifty}, scale=\tikzcuboidkey{scale}, rotate=\tikzcuboidkey{rotation}, x={(\vectorxx,\vectorxy)}, y={(\vectoryx,\vectoryy)}, z={(\vectorzx,\vectorzy)}] \pgfmathsetmacro{\steppingx}{1/\tikzcuboidkey{densityx}} \pgfmathsetmacro{\steppingy}{1/\tikzcuboidkey{densityy}} \pgfmathsetmacro{\steppingz}{1/\tikzcuboidkey{densityz}} \newcommand{\dimx}{\tikzcuboidkey{dimx}} \newcommand{\dimy}{\tikzcuboidkey{dimy}} \newcommand{\dimz}{\tikzcuboidkey{dimz}} \pgfmathsetmacro{\secondx}{2*\steppingx} \pgfmathsetmacro{\secondy}{2*\steppingy} \pgfmathsetmacro{\secondz}{2*\steppingz} \foreach \x in {\steppingx,\secondx,...,\dimx} { \foreach \y in {\steppingy,\secondy,...,\dimy} { \pgfmathsetmacro{\lowx}{(\x-\steppingx)} \pgfmathsetmacro{\lowy}{(\y-\steppingy)} \filldraw[cuboid/front] (\lowx,\lowy,\dimz) -- (\lowx,\y,\dimz) -- (\x,\y,\dimz) -- (\x,\lowy,\dimz) -- cycle; } } \foreach \x in {\steppingx,\secondx,...,\dimx} { \foreach \z in {\steppingz,\secondz,...,\dimz} { \pgfmathsetmacro{\lowx}{(\x-\steppingx)} \pgfmathsetmacro{\lowz}{(\z-\steppingz)} \filldraw[cuboid/top] (\lowx,\dimy,\lowz) -- (\lowx,\dimy,\z) -- (\x,\dimy,\z) -- (\x,\dimy,\lowz) -- cycle; } } \foreach \y in {\steppingy,\secondy,...,\dimy} { \foreach \z in {\steppingz,\secondz,...,\dimz} { \pgfmathsetmacro{\lowy}{(\y-\steppingy)} \pgfmathsetmacro{\lowz}{(\z-\steppingz)} \filldraw[cuboid/right] (\dimx,\lowy,\lowz) -- (\dimx,\lowy,\z) -- (\dimx,\y,\z) -- (\dimx,\y,\lowz) -- cycle; } } \ifcuboidemphedge \draw[cuboid/emphstyle] (0,\dimy,0) -- (\dimx,\dimy,0) -- (\dimx,\dimy,\dimz) -- (0,\dimy,\dimz) -- cycle;% \draw[cuboid/emphstyle] (0,\dimy,\dimz) -- (0,0,\dimz) -- (\dimx,0,\dimz) -- (\dimx,\dimy,\dimz);% \draw[cuboid/emphstyle] (\dimx,\dimy,0) -- (\dimx,0,0) -- (\dimx,0,\dimz);% \fi \ifcuboidshade \pgfmathsetmacro{\cstepx}{\dimx/\tikzcuboidkey{shadesamples}} \pgfmathsetmacro{\cstepy}{\dimy/\tikzcuboidkey{shadesamples}} \pgfmathsetmacro{\cstepz}{\dimz/\tikzcuboidkey{shadesamples}} \foreach \s in {1,...,\tikzcuboidkey{shadesamples}} { \pgfmathsetmacro{\lows}{\s-1} \pgfmathsetmacro{\cpercent}{(\lows)/(\tikzcuboidkey{shadesamples}-1)*100} \fill[opacity=\tikzcuboidkey{shadeopacity},color=\tikzcuboidkey{shadecolorlight}!\cpercent!\tikzcuboidkey{shadecolordark}] (0,\s*\cstepy,\dimz) -- (\s*\cstepx,\s*\cstepy,\dimz) -- (\s*\cstepx,0,\dimz) -- (\lows*\cstepx,0,\dimz) -- (\lows*\cstepx,\lows*\cstepy,\dimz) -- (0,\lows*\cstepy,\dimz) -- cycle; \fill[opacity=\tikzcuboidkey{shadeopacity},color=\tikzcuboidkey{shadecolorlight}!\cpercent!\tikzcuboidkey{shadecolordark}] (0,\dimy,\s*\cstepz) -- (\s*\cstepx,\dimy,\s*\cstepz) -- (\s*\cstepx,\dimy,0) -- (\lows*\cstepx,\dimy,0) -- (\lows*\cstepx,\dimy,\lows*\cstepz) -- (0,\dimy,\lows*\cstepz) -- cycle; \fill[opacity=\tikzcuboidkey{shadeopacity},color=\tikzcuboidkey{shadecolorlight}!\cpercent!\tikzcuboidkey{shadecolordark}] (\dimx,0,\s*\cstepz) -- (\dimx,\s*\cstepy,\s*\cstepz) -- (\dimx,\s*\cstepy,0) -- (\dimx,\lows*\cstepy,0) -- (\dimx,\lows*\cstepy,\lows*\cstepz) -- (\dimx,0,\lows*\cstepz) -- cycle; } \fi \end{scope} } \makeatother \begin{document} \begin{tikzpicture} % cuboid #1 \tikzcuboid{% shiftx=0cm,% shifty=8cm,% scale=1.00,% rotation=0,% densityx=2,% densityy=2,% densityz=2,% dimx=3,% dimy=3,% dimz=3,% scalex=1,% scaley=1,% scalez=1,% anglex=-30,% angley=90,% anglez=210,% front/.style={draw=green!50!black,fill=green!50!white},% top/.style={draw=green!50!black,fill=green!50!white},% right/.style={draw=green!50!black,fill=green!50!white},% emphedge,% emphstyle/.style={line width=1pt, green!12!black,densely dashed}, shade,% shadesamples=64,% shadeopacity=0.15,% } \tikzcuboid{% % cuboid #2 shiftx=8cm,% shifty=8cm,% shadeopacity=0.30,% } \tikzcuboid{% % cuboid #3 shiftx=16cm,% shifty=8cm,% shadeopacity=0.60,% } \tikzcuboid{% % cuboid #4 shiftx=0cm,% shifty=0cm,% scale=1.00,% rotation=0,% densityx=1,% densityy=1,% densityz=1,% dimx=4,% dimy=4,% dimz=4,% front/.style={draw=blue!75!black,fill=blue!25!white},% right/.style={draw=blue!25!black,fill=blue!75!white},% top/.style={draw=blue!50!black,fill=blue!50!white},% anglex=-7,% angley=90,% anglez=221.5,% scalex=1,% scaley=1,% scalez=0.5,% emphedge=false,% shade,% shadeopacity=0.15,% } \tikzcuboid{% % cuboid #5 shiftx=8cm,% shifty=0cm,% shadeopacity=0.30,% } \tikzcuboid{% % cuboid #6 shiftx=16cm,% shifty=0cm,% shadeopacity=0.60,% } \end{tikzpicture} \end{document}
% Author: Izaak Neutelings (July, 2017) \documentclass{article} \usepackage{amsmath} % for \dfrac \usepackage{tikz} \tikzset{>=latex} % for LaTeX arrow head \usepackage{pgfplots} % for the axis environment \usetikzlibrary{calc} % to do arithmetic with coordinates \usetikzlibrary{angles,quotes} % for pic % colors \definecolor{mylightgrey}{RGB}{230,230,230} \definecolor{mygrey}{RGB}{190,190,190} \definecolor{mydarkgrey}{RGB}{110,110,110} \definecolor{mygreen}{RGB}{120,220,160} \definecolor{mydarkgreen}{RGB}{60,120,60} \definecolor{myverydarkgreen}{RGB}{20,60,20} \definecolor{mydarkred}{RGB}{140,40,40} % mark right angle \newcommand{\MarkRightAngle}[4][1.5mm] {\coordinate (tempa) at ($(#3)!#1!(#2)$); \coordinate (tempb) at ($(#3)!#1!(#4)$); \coordinate (tempc) at ($(tempa)!0.5!(tempb)$);%midpoint \draw (tempa) -- ($(#3)!2!(tempc)$) -- (tempb); } % split figures into pages \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{1pt}% \begin{document} % RUTHERFORD SCATTERING - hyperbola orbit \begin{tikzpicture}[scale=1] % limits & parameters \def\xa{-2.4} \def\xb{ 4} \def\ya{-4} \def\yb{ 4} \def\tmax{2.1} \def\a{1.3} \def\b{1} \def\c{{sqrt(\a^2+\b^2)}} \def\N{100} % number of points % coordinates \coordinate (O) at ( 0, 0 ); \coordinate (A) at ( \a, 0 ); \coordinate (F1) at ( {sqrt(\a^2+\b^2)}, 0 ); \coordinate (F2) at ( -{sqrt(\a^2+\b^2)}, 0 ); \coordinate (P) at ( -{\a^2/sqrt(\a^2+\b^2)}, -{\a*\b/sqrt(\a^2+\b^2)} ); \coordinate (P1) at (\xb*\a, \yb*\b); \coordinate (P2) at (\xb*\a,-\yb*\b); \coordinate (yshift) at (0,0.4); % axes & asymptotes \draw[mygrey] % x axis (\xa*\a,0) -- (\xb*\a,0); \draw[dashed,mydarkgrey] (-\xb*\a*0.45, \ya*\b*0.45) -- (\xb*\a, \yb*\b) (-\xb*\a*0.45,-\ya*\b*0.45) -- (\xb*\a,-\yb*\b); % arrows \def\vtheta{30} \def\vradius{0.8} \draw[->,myverydarkgreen,shift=($(P1)-(yshift)$),scale=0.6] (0,0) -- (-\a,-\b) node[midway,below right=0pt] {${v}_i$}; \draw[->,myverydarkgreen,shift=($(P2)+(yshift)$),scale=0.6] (-\a,\b) -- (0,0) node[midway,above right=-2pt] {${v}_f$}; \draw[->,myverydarkgreen] (\a+0.35,{\vradius*sin(\vtheta)}) arc (180-\vtheta:180+\vtheta+10:\vradius) node[above right=0pt] {$v^*$}; % angles \MarkRightAngle{F2}{P}{O} \pic [draw,myverydarkgreen,"$\theta$",angle radius=12,angle eccentricity=1.4] {angle = F2--O--P}; \pic [draw,below,angle radius=16,angle eccentricity=1.4] {angle = P2--O--P1}; \node[right=1pt,below=-2pt,myverydarkgreen] at ($(O)!0.5!(A)$) {\small$\phi$}; % hyperbola \draw[color=mylightgrey,line width=0.5,samples=\N,variable=\t,domain=-\tmax*0.58:\tmax*0.58] % left plot({-\a*cosh(\t)},{\b*sinh(\t)}); \draw[color=mydarkgreen,line width=1,samples=\N,variable=\t,domain=-\tmax:\tmax] % right plot({ \a*cosh(\t)},{\b*sinh(\t)}); % {exp(\y)+exp(-\y) % nodes \draw[myverydarkgreen] (F2) -- (P) node[midway,below left=1pt,] {$b$}; \fill[radius=1.5pt] (A) circle node[above left=0pt] {A} (O) circle node[above=2pt] {O}; \fill[radius=2.5pt,mydarkred] (F2) circle node[above=2pt] {N}; \draw[] %(O) -- (F2) node[left=1pt,above=0pt] at ($(F2)!0.5!(O)$) {$c$} node[below right] at ($(P)!0.5!(O)$) {$a$}; % alpha particle \draw[radius=1pt,mydarkgreen,fill] ({ \a*cosh(\tmax*1.02)},{\b*sinh(\tmax*1.02)}) circle node[above right=0pt] {$\alpha$}; \end{tikzpicture} % RUTHERFORD SCATTERING - hyperbolic orbits with different impact parameters \begin{tikzpicture}[scale=1] % limits & parameters \def\xa{-35} \def\xb{ 55} \def\ya{ -1} \def\yb{ 55} \def\tmax{4.5} \def\N{50} % number of points % use axes to get square box which cuts of the long curves \begin{axis}[ xmin=\xa,xmax=\xb, ymin=\ya,ymax=\yb, hide x axis, hide y axis, xticklabels={,,},yticklabels={,,} axis line style={draw=none}, tick style={draw=none} ] % loop over multiples \u of impact parameters \b=\u*0.25 \def\a{1} \foreach \u in {1,3,6,10,15,21,28,38}{ \def\b{\u*0.25} \def\c{sqrt(\a^2+\b^2)} % hyperbola \addplot[color=mydarkgreen,line width=0.5,samples=\N,smooth,variable=\t,domain=-\tmax:\tmax] ({ \a/\c*(-\a*cosh(\t)-\c) + \b/\c*\b*sinh(\t) }, { -\b/\c*(-\a*cosh(\t)-\c) + \a/\c*\b*sinh(\t) }); } % nucleus \addplot[mydarkred,mark=*,mark size=2pt,mark options=solid] coordinates {(0,0)}; \end{axis} \end{tikzpicture} \end{document}
\documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage{tikz} \usetikzlibrary{shapes,decorations,calc} \usepackage{amsmath,amssymb} \begin{document} \begin{preview} \begin{tikzpicture}[% auto, example/.style={ rectangle, draw=blue, thick, fill=blue!20, text width=4.5em, align=center, rounded corners, minimum height=2em }, algebraicName/.style={ text width=7em, align=center, minimum height=2em }, explanation/.style={ text width=10em, align=left, minimum height=3em } ] \draw[fill=yellow!20,yellow!20, rounded corners] (-1.85, 0.55) rectangle (13.4,-6.85); \draw[fill=black!20,black!20, rounded corners] ( 7.53,-1.40) rectangle (13.0,-6.45); \draw[fill=lime!20,lime!20, rounded corners] (-1.75, 0.45) rectangle (7.3,-6.75); \draw[fill=purple!20,purple!20, rounded corners] (-1.65,-1.40) rectangle (7.2,-6.65); \draw[fill=blue!20,blue!20, rounded corners] (-1.55,-3.55) rectangle (7.1,-6.55); \draw[fill=red!20,red!20, rounded corners] (-1.45,-4.65) rectangle (7.0,-6.45); \draw (0, 0) node[algebraicName] (A) {Gruppe} (2, 0) node[explanation] (B) { \begin{minipage}{0.90\textwidth} \tiny \begin{itemize} \itemsep -0.3em \item Assoziativit\"at \item Neutrales Element \item Inverse Elemente \end{itemize} \end{minipage} } (6, 0) node[example, draw=lime, fill=lime!15] (X) {$\text{GL}(n, \mathbb{K})$} (6,-1) node[example, draw=lime, fill=lime!15] (X) {$\text{O}(n)$} (0,-2) node[algebraicName, purple] (C) {abelsche Gruppe} (2,-2) node[explanation] (X) { \begin{minipage}{150\textwidth} \tiny \begin{itemize} \itemsep -0.3em \item kommutativ \end{itemize} \end{minipage} } (2, -3) node[example, draw=purple, fill=purple!15] (D) {$(\mathbb{Z}, +)$} (4, -3) node[example, draw=purple, fill=purple!15] (E) {$(\mathbb{Q} \setminus \{0\}, \cdot)$} (6, -3) node[example, draw=purple, fill=purple!15] (X) {$\mathbb{Z}_1$} (10,-6) node[example, draw=black, fill=black!15] (F) {$(\mathbb{N}_0, +)$} (12,-6) node[example, draw=black, fill=black!15] (G) {$(\mathbb{N}_0, \cdot)$} (0,-4) node[algebraicName, blue] (H) {Ring} (2,-4.1) node[explanation] (X) { \begin{minipage}{150\textwidth} \tiny \begin{itemize} \itemsep -0.3em \item Zwei Verkn\"upfungen \item $(R, +)$ ist abelsche Gruppe \item $(R, \cdot)$ ist Halbgruppe \item Distributivgesetze \end{itemize} \end{minipage} } (6,-4) node[example, draw=blue, fill=blue!15] (I) {$(\mathbb{Z}, +, \cdot)$} (0,-5) node[algebraicName, red] (J) {K\"orper} (2,-5) node[explanation] (X) { \begin{minipage}{150\textwidth} \tiny \begin{itemize} \itemsep -0.3em \item $(\mathbb{K} \setminus \{0\}, \cdot)$ ist abelsche Gruppe \end{itemize} \end{minipage} } (0,-6) node[example, draw=red, fill=red!15] (K) {$(\mathbb{Q}, +, \cdot)$} (2,-6) node[example, draw=red, fill=red!15] (L) {$(\mathbb{R}, +, \cdot)$} (4,-6) node[example, draw=red, fill=red!15] (M) {$(\mathbb{C}, +, \cdot)$} (6,-6) node[example, draw=red, fill=red!15] (N) {$\mathbb{Z} / p \mathbb{Z}$} (9, 0) node[algebraicName] (O) {Halbgruppe} (12,0) node[explanation] (X) { \begin{minipage}{150\textwidth} \tiny \begin{itemize} \itemsep -0.3em \item Eine Verkn\"upfung \item Abgeschlossenheit \end{itemize} \end{minipage} } (12,-1) node[example, draw=yellow, fill=yellow!15] (P) {$(\emptyset, \emptyset)$} (9, -2) node[algebraicName] (Q) {kommutative Halbgruppe} (12,-2) node[explanation] (X) { \begin{minipage}{150\textwidth} \tiny \begin{itemize} \itemsep -0.3em \item kommutativ \end{itemize} \end{minipage} }; % Körper \draw[red,thick, rounded corners] ($(J.north west)+(-0.1,0.0)$) rectangle ($(N.south east)+(0.1,-0.1)$); % Ring \draw[blue, thick, rounded corners] ($(H.north west)+(-0.2,0.1)$) rectangle ($(N.south east)+(0.2,-0.2)$); % abelsche Gruppe \draw[purple, thick, rounded corners] ($(C.north west)+(-0.3,0.1)$) rectangle ($(N.south east)+(0.3,-0.3)$); % Gruppe \draw[lime, thick, rounded corners] ($(A.north west)+(-0.4,0.1)$) rectangle ($(N.south east)+(0.4,-0.4)$); % Halbgruppe \draw[yellow, thick, rounded corners] ($(A.north west)+(-0.5,0.2)$) rectangle ($(G.south east)+(0.5,-0.5)$); % Halbgruppe \draw[black, thick, rounded corners] ($(Q.north west)+(-0.1,0.1)$) rectangle ($(G.south east)+(0.1,-0.1)$); \end{tikzpicture} \end{preview} \end{document}
\documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{shapes, calc, shapes, arrows, snakes} \newcommand{\width}{0.2} \begin{document} \begin{preview} \tikzstyle{input}=[draw,fill=red!50] \tikzstyle{conv}=[draw,fill=black!20] \tikzstyle{max}=[draw,dashed,fill=black!10] \tikzstyle{dropout}=[draw,dashed,fill=blue!10] \tikzstyle{fc}=[draw,fill=green!10] \tikzstyle{output}=[draw,fill=red!50] \def \coldist {2.5} \def \widthb {2} \tikzstyle{stateTransition}=[->, very thick] \begin{tikzpicture}[scale=2] \draw[->, line width=5pt] (1.0+0*\coldist, 0.5) --(1.0+0*\coldist, -2.2) --(2.1+0*\coldist, -2.2) --(2.5+0*\coldist, 0.5) -- (1.0+1*\coldist, 0.5) --(1.0+1*\coldist, -2.2) --(2.1+1*\coldist, -2.2) --(2.5+1*\coldist, 0.5) -- (1.0+2*\coldist, 0.5) --(1.0+2*\coldist, -2.9) --(2.1+2*\coldist, -2.9) --(2.5+2*\coldist, 0.5) -- (1.0+3*\coldist, 0.5) --(1.0+3*\coldist, -2.9) --(2.1+3*\coldist, -2.9) --(2.5+3*\coldist, 0.5) -- (1.0+4*\coldist, 0.5) --(1.0+4*\coldist, -2.9) --(2.1+4*\coldist, -2.9) --(2.5+4*\coldist, 0.5) -- (1.0+5*\coldist, 0.5) --(1.0+5*\coldist, -4.5); % \draw[->, line width=5pt] (6.5, -2.8) % -- (1.0, -2.8) -- (1.0, -6.5) -- (2.0, -6.5) -- (3.0, -3.0) % -- (4.0, -3.0) -- (4.0, -6.5) -- (5.0, -6.5) -- (6.0, -3.0) % -- (7.0, -3.0) -- (7.0, -7.0); \draw[draw=none] (0*\coldist,-0.5) rectangle (1.0,-0.7) node[pos=.5] {$224 \times 224$}; \draw[input] (0*\coldist, 0.0) rectangle (2.0,-0.5) node[pos=.5] {Input}; \draw[conv] (0*\coldist,-0.7) rectangle (2.0,-1.2) node[pos=.5] {C $64@3 \times 3 / 1$}; \draw[conv] (0*\coldist,-1.4) rectangle (2.0,-1.9) node[pos=.5] {C $64@3 \times 3 / 1$}; \draw[draw=none] (1*\coldist,-0.5) rectangle (1*\coldist+\widthb/2,-0.7) node[pos=.5] {$112 \times 112$}; \draw[max] (1*\coldist, 0.0) rectangle (1*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$}; \draw[conv] (1*\coldist,-0.7) rectangle (1*\coldist+\widthb,-1.2) node[pos=.5] {C $128@3 \times 3 / 1$}; \draw[conv] (1*\coldist,-1.4) rectangle (1*\coldist+\widthb,-1.9) node[pos=.5] {C $128@3 \times 3 / 1$}; \draw[draw=none] (2*\coldist,-0.5) rectangle (2*\coldist+\widthb/2,-0.7) node[pos=.5] {$56 \times 56$}; \draw[max] (2*\coldist, 0.0) rectangle (2*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$}; \draw[conv] (2*\coldist,-0.7) rectangle (2*\coldist+\widthb,-1.2) node[pos=.5] {C $256@3 \times 3 / 1$}; \draw[conv] (2*\coldist,-1.4) rectangle (2*\coldist+\widthb,-1.9) node[pos=.5] {C $256@3 \times 3 / 1$}; \draw[conv] (2*\coldist,-2.1) rectangle (2*\coldist+\widthb,-2.6) node[pos=.5] {C $256@3 \times 3 / 1$}; % second line \draw[draw=none] (3*\coldist,-0.5) rectangle (3*\coldist+\widthb/2,-0.7) node[pos=.5] {$28 \times 28$}; \draw[max] (3*\coldist,-0.0) rectangle (3*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$}; \draw[conv] (3*\coldist,-0.7) rectangle (3*\coldist+\widthb,-1.2) node[pos=.5] {C $512@3 \times 3 / 1$}; \draw[conv] (3*\coldist,-1.4) rectangle (3*\coldist+\widthb,-1.9) node[pos=.5] {C $512@3 \times 3 / 1$}; \draw[conv] (3*\coldist,-2.1) rectangle (3*\coldist+\widthb,-2.6) node[pos=.5] {C $512@3 \times 3 / 1$}; \draw[draw=none] (4*\coldist,-0.5) rectangle (4*\coldist+\widthb/2,-0.7) node[pos=.5] {$14 \times 14$}; \draw[max] (4*\coldist,-0.0) rectangle (4*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$}; \draw[conv] (4*\coldist,-0.7) rectangle (4*\coldist+\widthb,-1.2) node[pos=.5] {C $512@3 \times 3 / 1$}; \draw[conv] (4*\coldist,-1.4) rectangle (4*\coldist+\widthb,-1.9) node[pos=.5] {C $512@3 \times 3 / 1$}; \draw[conv] (4*\coldist,-2.1) rectangle (4*\coldist+\widthb,-2.6) node[pos=.5] {C $512@3 \times 3 / 1$}; \draw[draw=none] (5*\coldist,-0.5) rectangle (5*\coldist+\widthb/2,-0.7) node[pos=.5] {$7 \times 7$}; \draw[max] (5*\coldist,-0.0) rectangle (5*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$}; \draw[fc] (5*\coldist,-0.7) rectangle (5*\coldist+\widthb,-1.2) node[pos=.5] {Fully Connected 4096}; \draw[dropout] (5*\coldist,-1.4) rectangle (5*\coldist+\widthb,-1.9) node[pos=.5] {Dropout $0.5$}; \draw[fc] (5*\coldist,-2.1) rectangle (5*\coldist+\widthb,-2.6) node[pos=.5] {Fully Connected 4096}; \draw[dropout] (5*\coldist,-2.8) rectangle (5*\coldist+\widthb,-3.3) node[pos=.5] {Dropout $0.5$}; \draw[output] (5*\coldist,-3.5) rectangle (5*\coldist+\widthb,-4.0) node[pos=.5] {Fully Connected 1000}; \end{tikzpicture} \end{preview} \end{document}
\documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{shapes, calc, shapes, arrows, snakes} \newcommand{\width}{0.2} \begin{document} \begin{preview} \tikzset{sigmoid/.style={path picture= { \begin{scope}[x=1pt,y=10pt] \draw plot[domain=-7:7] (\x,{1/(1 + exp(-\x))-0.5}); \end{scope} } } } \tikzset{relu/.style={path picture= { \begin{scope}[x=7pt,y=6pt] \draw plot[domain=-1:0] (\x,0); \draw plot[domain=0:1] (\x,\x); \end{scope} } } } \tikzstyle{input}=[draw,fill=red!50,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{hidden}=[draw,fill=green!50,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{output}=[draw,fill=white,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{bias}=[draw,dashed,fill=gray!50,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{layer}=[fill=gray!70] \tikzstyle{stateTransition}=[->, very thick] \begin{tikzpicture}[scale=2] \node (i0)[bias] at (0, 0) {1}; \node (i1)[input] at (0, 0.5) {}; \node (i2)[input] at (0, 1.0) {}; \node (i3)[input] at (0, 1.5) {}; \node (h1)[hidden] at (1, 2.0) {}; \node (h2)[hidden] at (2, 2.5) {}; \node (h3)[hidden] at (3, 3.0) {}; \node (o1)[output] at (4, 3.5) {}; \node (o2)[output] at (5, 3.5) {}; \draw[stateTransition] (i0) -- (6, 0); \draw[stateTransition] (i1) -- (6, 0.5); \draw[stateTransition] (i2) -- (6, 1.0); \draw[stateTransition] (i3) -- (6, 1.5); \draw[stateTransition] (h1) -- (6, 2.0); \draw[stateTransition] (h2) -- (6, 2.5); \draw[stateTransition] (h3) -- (6, 3.0); \draw[stateTransition] (1, 0) -- (h1); \draw[stateTransition] (2, 0) -- (h2); \draw[stateTransition] (3, 0) -- (h3); \draw[stateTransition] (4, 0) -- (o1); \draw[stateTransition] (5, 0) -- (o2); \foreach \x in {1,...,3} { \pgfmathsetmacro{\limy}{(2+\x) / 2} \foreach \y in {0, 0.5, ..., \limy} { \node[rectangle,draw=black,fill=black,minimum size=12] (box) at (\x,\y) {}; } } \foreach \x in {4,...,5} { \foreach \y in {0, ..., 6} { \pgfmathsetmacro{\yn}{0.5*\y} \node[rectangle,draw=black,fill=white,minimum size=12] (box) at (\x,\yn) {}; } } % \node (h11)[hidden, sigmoid] at (1, 1.5) {}; % \node (h12)[hidden, sigmoid] at (1, 0.5) {}; % \node[circle, inner sep=0] (h13) at (1,-0.5) {\vdots}; % \node (h14)[hidden, sigmoid] at (1,-1.5) {}; % \node (h21)[hidden, relu] at (2, 1.5) {}; % \node (h22)[hidden, relu] at (2, 0.5) {}; % \node[circle, inner sep=0] (h23) at (2,-0.5) {\vdots}; % \node (h24)[hidden, relu] at (2,-1.5) {}; % \node (o1)[output, sigmoid] at (3,0) {}; % \draw[stateTransition] (r) -- (h11) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (r) -- (h12) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (r) -- (h13) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (r) -- (h14) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (g) -- (h11) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (g) -- (h12) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (g) -- (h13) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (g) -- (h14) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (b) -- (h11) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (b) -- (h12) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (b) -- (h13) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (b) -- (h11) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h11) -- (h21) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h11) -- (h22) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h11) -- (h23) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h11) -- (h24) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h12) -- (h21) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h12) -- (h22) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h12) -- (h23) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h12) -- (h24) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h13) -- (h21) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h13) -- (h22) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h13) -- (h23) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h13) -- (h24) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h14) -- (h21) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h14) -- (h22) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h14) -- (h23) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h14) -- (h21) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h21) -- (o1) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h22) -- (o1) node [midway,above=-0.10cm] {}; % \draw[stateTransition] (h23) -- (o1) node [midway,above=-0.06cm] {}; % \draw[stateTransition] (h24) -- (o1) node [midway,above=-0.06cm] {}; % \draw [ % thick, % decoration={ % brace, % mirror, % raise=0.5cm % }, % decorate % ] (1+-\width, -1.8) -- (2+\width, -1.8) % node [pos=0.5,anchor=north,yshift=-0.55cm] {50\% dropout}; \end{tikzpicture} \end{preview} \end{document}
\documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage[utf8]{inputenc} % this is needed for german umlauts \usepackage[ngerman]{babel} % this is needed for german umlauts \usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf \usepackage{tikz} \usetikzlibrary{arrows,shapes} \usepackage{pgfplots} % argument #1: any options \newenvironment{customlegend}[1][]{% \begingroup % inits/clears the lists (which might be populated from previous % axes): \csname pgfplots@init@cleared@structures\endcsname \pgfplotsset{#1}% }{% % draws the legend: \csname pgfplots@createlegend\endcsname \endgroup }% % makes \addlegendimage available (typically only available within an % axis environment): \def\addlegendimage{\csname pgfplots@addlegendimage\endcsname} \begin{document} \begin{preview} \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=3.5cm, pflicht/.style ={rectangle, draw=blue, thick, fill=blue!20,align=center, rounded corners, minimum height=2em}, stammmodul/.style ={rectangle, draw=yellow, thick, fill=yellow!20,align=center, rounded corners, minimum height=2em}, wahl/.style ={rectangle, draw=green, thick, fill=green!20,align=center, rounded corners, minimum height=2em}, soft/.style ={rectangle, draw=red, thick, fill=red!20,align=center, rounded corners, minimum height=2em}] % Draw the vertices. \node[pflicht] (programmieren) {Programmieren}; \node[pflicht] (gbi) [right of=programmieren] {GBI}; \node[pflicht] (lai) [right of=gbi] {LA I}; \node[pflicht] (anai) [right of=lai] {ANA I}; \node[pflicht] (laii) [below of=lai] {LA II}; \node[pflicht] (anaii) [below of=anai] {ANA II}; \node[pflicht] (algi) [below of=gbi] {Algorithmen I}; \node[pflicht] (swti) [below of=programmieren] {SWT I}; \node[pflicht] (ro) [right of=anaii] {RO}; \node[pflicht] (dt) [below of=ro] {DT}; \node[pflicht] (wt) [left of=dt] {WT}; \node[pflicht] (tgi) [left of=wt] {TGI}; \node[pflicht] (os) [left of=tgi] {OS}; \node[pflicht] (pse) [left of=os] {PSE}; \node[soft] (tse) [left of=pse] {TSE}; \node[pflicht] (numerik) [below of=pse] {Numerik}; \node[pflicht] (datenbanken) [right of=numerik] {Datenbanken}; \node[pflicht] (rechnernetze) [below of=wt] {Rechnernetze}; \node[stammmodul] (KogSys) [right of=rechnernetze] {KogSys}; \node[stammmodul] (Echtzeitsysteme) [right of=KogSys] {Echtzeit-Sys.}; \node[stammmodul] (Rechnerstrukturen) [right of=Echtzeitsysteme] {Rechnerstrukturen}; \node[pflicht] (algii) [right of=datenbanken, below of=datenbanken] {Algorithmen II}; \node[pflicht] (propa) [right of=algii] {Programmierparadigmen}; \node[wahl] (icpc) [below of=algii] {ICPC}; \node[wahl] (web) [left of=swti] {Web Engineering}; % Connect vertices with edges and draw weights \path[->] (gbi) edge[thick] node[anchor=center,above,sloped] {\tiny{Automaten}} (tgi); \path[->] (algi) edge node {} (algii); \path[->] (tgi) edge node[anchor=center,above,sloped] {\tiny{ILP}} (algii); \path[->] (tgi) edge[red] node {} (propa); \path[->] (wt) edge node[anchor=center,above,sloped] {\tiny{Randomisierte Algorithmen}} (algii); \path[->] (wt) edge node[anchor=center,above,sloped] {\tiny{Bayes Regel}} (KogSys); \path[->] (dt) edge node[anchor=center,above,sloped] {\tiny{Zahlendarstellungen}} (ro); \path[->] (lai) edge[ultra thick] node[anchor=center,above,sloped] {\tiny{Gruppe, Körper, \dots}} (laii); \path[<->] (lai) edge node {} (gbi); \path[->] (lai) edge node[anchor=center,above,sloped] {\tiny{Matrixmultiplikation; Lösen von linearen Gleichungssystemen}} (numerik); \path[->] (anai) edge[bend left=10] node[anchor=center,above,sloped] {\tiny{Banachscher Fixpunktsatz}} (numerik); \path[<->] (gbi) edge[bend left] node [anchor=center,above,sloped] {\tiny{Induktion}} (anai); \path[->] (anai) edge[ultra thick] node {} (anaii); \path[->] (laii) edge[bend left] node[anchor=center,above,sloped] {\tiny{Mathematische Strukturen}} (algii); \path[->] (programmieren) edge[very thick] node[anchor=center,above,sloped] {\tiny{Java}} (swti); \path[->] (programmieren) edge[bend left] node {} (pse); \path[->] (programmieren) edge node {} (os); \path[->] (swti) edge[red] node {} (pse); \path[<->] (ro) edge node[anchor=center,above,sloped] {\tiny{Assembler, Adressierung, Caches}} (os); \path[<->] (algii) edge [very thick] node {} (icpc); \path[->] (swti) edge node[anchor=center,above,sloped] {\tiny{Prozessmodelle}} (web); \path[<->] (pse) edge[red] node {} (tse); \path[->] (laii) edge[red] node {} (pse); \path[->] (anaii) edge[red] node {} (pse); \path[->] (programmieren) edge[red, bend right] node {} (pse); %\path[->] (algi) edge[red] node {} (pse); \path[->] (algi) edge[bend left] node[anchor=center,above,sloped] {\tiny{B-Bäume}} (datenbanken); \path[->] (swti) edge[red, bend right] node {} (pse); \path[->] (gbi) edge[red] node {} (pse); \path[<->] (os) edge node[anchor=center,above,sloped] {\tiny{Paging}} (algii); \path[->] (ro) edge[thick] node[anchor=center,above,sloped] {\tiny{Bus, ROS, CAS, Microprozessoraufbau}} (Echtzeitsysteme); \path[->] (anaii) edge[bend right] node[anchor=center,above,sloped] {\tiny{Differenzialgleichungen}} (Echtzeitsysteme); \path[->] (ro) edge[bend left] node[anchor=center,above,sloped] {\tiny{Pipelining, CISC, RISC}} (Rechnerstrukturen); \begin{customlegend}[legend entries={Pflichtmodul,Stammmodul,Wahlmodul,Softskill,Inhaltliche Abhängigkeit,Harte Abhängigkeit},legend style={at={(-3,-12)},anchor=center}] \addlegendimage{blue,fill=blue!20,area legend} \addlegendimage{yellow,fill=yellow!20,area legend} \addlegendimage{green,fill=green!20,area legend} \addlegendimage{red,fill=red!20,area legend} \addlegendimage{->,black,sharp plot} \addlegendimage{->,red,sharp plot} %\addlegendimage{red,fill=black!50!red,mark=*,sharp plot} %\addlegendimage{red,fill=black!50!red,ybar,ybar legend} \end{customlegend} \end{tikzpicture} \end{preview} \end{document}
\documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{shapes, calc, shapes, arrows, snakes} \newcommand{\width}{0.2} \begin{document} \begin{preview} \tikzset{sigmoid/.style={path picture= { \begin{scope}[x=1pt,y=10pt] \draw plot[domain=-7:7] (\x,{1/(1 + exp(-\x))-0.5}); \end{scope} } } } \tikzset{relu/.style={path picture= { \begin{scope}[x=7pt,y=6pt] \draw plot[domain=-1:0] (\x,0); \draw plot[domain=0:1] (\x,\x); \end{scope} } } } \tikzstyle{input}=[draw,fill=red!50,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{hidden}=[draw,fill=green!50,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{output}=[draw,fill=white,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{bias}=[draw,dashed,fill=gray!50,circle,minimum size=20pt,inner sep=0pt] \tikzstyle{layer}=[fill=gray!70] \tikzstyle{stateTransition}=[->, thick] \begin{tikzpicture}[scale=2] \fill[layer] (-\width,-1.7) rectangle (\width,1.7); \fill[layer] (1+-\width,-1.7) rectangle (1+\width,1.7); \fill[layer] (2+-\width,-1.7) rectangle (2+\width,1.7); \fill[layer] (3+-\width,-1.7) rectangle (3+\width,1.7); \node (l1label) at (0, -1.9) {3}; \node (l2label) at (1, -1.9) {64}; \node (l3label) at (2, -1.9) {64}; \node (l4label) at (3, -1.9) {1}; \node (r)[input,fill=red] at (0, 1) {R}; \node (g)[input,fill=green] at (0, 0) {G}; \node (b)[input,fill=blue] at (0,-1) {B}; \node (h11)[hidden, sigmoid] at (1, 1.5) {}; \node (h12)[hidden, sigmoid] at (1, 0.5) {}; \node[circle, inner sep=0] (h13) at (1,-0.5) {\vdots}; \node (h14)[hidden, sigmoid] at (1,-1.5) {}; \node (h21)[hidden, relu] at (2, 1.5) {}; \node (h22)[hidden, relu] at (2, 0.5) {}; \node[circle, inner sep=0] (h23) at (2,-0.5) {\vdots}; \node (h24)[hidden, relu] at (2,-1.5) {}; \node (o1)[output, sigmoid] at (3,0) {}; \draw[stateTransition] (r) -- (h11) node [midway,above=-0.06cm] {}; \draw[stateTransition] (r) -- (h12) node [midway,above=-0.06cm] {}; \draw[stateTransition] (r) -- (h13) node [midway,above=-0.06cm] {}; \draw[stateTransition] (r) -- (h14) node [midway,above=-0.06cm] {}; \draw[stateTransition] (g) -- (h11) node [midway,above=-0.06cm] {}; \draw[stateTransition] (g) -- (h12) node [midway,above=-0.06cm] {}; \draw[stateTransition] (g) -- (h13) node [midway,above=-0.06cm] {}; \draw[stateTransition] (g) -- (h14) node [midway,above=-0.06cm] {}; \draw[stateTransition] (b) -- (h11) node [midway,above=-0.06cm] {}; \draw[stateTransition] (b) -- (h12) node [midway,above=-0.06cm] {}; \draw[stateTransition] (b) -- (h13) node [midway,above=-0.06cm] {}; \draw[stateTransition] (b) -- (h11) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h11) -- (h21) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h11) -- (h22) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h11) -- (h23) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h11) -- (h24) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h12) -- (h21) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h12) -- (h22) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h12) -- (h23) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h12) -- (h24) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h13) -- (h21) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h13) -- (h22) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h13) -- (h23) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h13) -- (h24) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h14) -- (h21) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h14) -- (h22) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h14) -- (h23) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h14) -- (h21) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h21) -- (o1) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h22) -- (o1) node [midway,above=-0.10cm] {}; \draw[stateTransition] (h23) -- (o1) node [midway,above=-0.06cm] {}; \draw[stateTransition] (h24) -- (o1) node [midway,above=-0.06cm] {}; \draw [ thick, decoration={ brace, mirror, raise=0.5cm }, decorate ] (1+-\width, -1.8) -- (2+\width, -1.8) node [pos=0.5,anchor=north,yshift=-0.55cm] {50\% dropout}; \end{tikzpicture} \end{preview} \end{document}
\documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage{tikz} \usetikzlibrary{arrows, calc, positioning,decorations.pathreplacing,shapes} \begin{document} \begin{preview} \begin{tikzpicture}[scale=0.5] \coordinate (A) at (0,1); \coordinate (B1) at (1,0); \coordinate (B2) at (15,0); \draw (A) -- (16,1); \draw (B1) -- (1,16); \draw (B2) -- (15,16); % to transistors T4 and T5 \draw (3,1) -- (3,7); \draw (13,1) -- (13,7); % transistors T4 and T5 \draw ( 2,7) -- ( 4,7); \draw (12,7) -- (14,7); \draw[dashed] ( 2,7.25) -- ( 4,7.25); \draw[dashed] (12,7.25) -- (14,7.25); \draw ( 2.5,7.25) -- ( 2.5, 7.5); % T5 - tiny to top \draw ( 3.5,7.25) -- ( 3.5, 7.5); % T5 - tiny to top \draw ( 2.5, 7.5) -- ( 1, 7.5); % T5 - to left \draw ( 3.5, 7.5) -- ( 7, 7.5); % T5 - to right \draw[-latex] ( 3, 8) -- ( 3, 7.25 ); % T5 - Gate \draw[fill=black] (1,7.5) circle (0.1); % T5- dot \draw (12.5,7.25) -- (12.5, 7.5); % T4 - tiny to top \draw (13.5,7.25) -- (13.5, 7.5); % T4 - tiny to top \draw (12.5, 7.5) -- (9.0, 7.5); % T4 - to left \draw (13.5, 7.5) -- (15.0, 7.5); % T4 - to right \draw[-latex] ( 13, 8) -- ( 13, 7.25 ); % T4 - Gate \draw[fill=black] (15,7.5) circle (0.1); % T4- dot % center - left part \draw (5,4) -- (5,5); % line to top \draw (5,6) -- (5,10); % line to top \draw (5,11) -- (5,12); % line to top \draw (5,5) -- (5.25,5); % T1 - right \draw (5,6) -- (5.25,6); % T1 - right \draw (5,10) -- (5.25,10); % T3 - right \draw (5,11) -- (5.25,11); % T3 - right \draw[dashed] (5.25,4.5) -- (5.25, 6.5); % T1 \draw (5.50,4.5) -- (5.50, 6.5); % T1 \draw[dashed] (5.25,9.5) -- (5.25,11.5); % T3 \draw (5.50,9.5) -- (5.50,11.5); % T3 \draw[-latex] (4.5,5.5) -- (5.25, 5.5); % T1 - Gate \draw[latex-] (4.5,10.5) -- (5.25,10.5); % T3 - Gate \draw (5.5, 5.5) -- (7, 5.5); % T1 - rechts \draw (5.5,10.5) -- (7,10.5); % T3 - rechts \draw[fill=black] (5,7.5) circle (0.1); \draw[fill=black] (7,7.5) circle (0.1); % center - right part \draw (11,4) -- (11,5); % line to top \draw (11,6) -- (11,10); % line to top \draw (11,11) -- (11,12); % line to top \draw (11,5) -- (10.75,5); % T0 - left \draw (11,6) -- (10.75,6); % T0 - right \draw (11,10) -- (10.75,10); % T2 - right \draw (11,11) -- (10.75,11); % T2 - right \draw[dashed] (10.75,4.5) -- (10.75, 6.5); % T0 \draw (10.50,4.5) -- (10.50, 6.5); % T0 \draw[dashed] (10.75,9.5) -- (10.75,11.5); % T2 \draw (10.50,9.5) -- (10.50,11.5); % T2 \draw[latex-] (10.75,5.5) -- (11.50, 5.5); % T0 - Gate \draw[-latex] (10.75,10.5) -- (11.50,10.5); % T1 - Gate \draw (10.5, 5.5) -- (9, 5.5); % T0 - rechts \draw (10.5,10.5) -- (9,10.5); % T1 - rechts \draw[fill=black] (11,7.5) circle (0.1); \draw[fill=black] (9,7.5) circle (0.1); % bottom \draw (5,4) -- (11,4); \draw (8,4) -- (8,3); \draw (7.25,3) -- (8.75,3); \draw (7.5,2.75) -- (8.5,2.75); % top \draw (5,12) -- (11,12); \draw (8,12) -- (8,15); \draw[fill=black] (8,12) circle (0.1); % middle \draw (7,5.5) -- (9,7.5); \draw (7,7.5) -- (9,5.5); \draw (7,10.5) -- (9,7.5); \draw (7,7.5) -- (9,10.5); \node (T5-label) at (3.2,8.4){$T_5$}; \node (T4-label) at (13.2,8.4){$T_4$}; \node (T3-label) at (4,10.5){$T_3$}; \node (T1-label) at (4,5.5){$T_1$}; \node (T3-label) at (12,10.5){$T_2$}; \node (T1-label) at (12,5.5){$T_0$}; \node (A-label) [left=1ex of A] {$A$}; \node (B1-label) [below=1ex of B1] {$B_1$}; \node (B2-label) [below=1ex of B2] {$B_2$}; \node (U-label) at (8,15.5) {$+U_B$}; \end{tikzpicture} \end{preview} \end{document}
\documentclass[border=2pt]{standalone} \usepackage{tikz} \usetikzlibrary{matrix,calc} %internal group %#1-space between node and grouping line. Default=0 %#2-top left node %#3-bottom right node \newcommand{\implicant}[3][0]{ \draw[rounded corners=3pt] ($(#2.north west)+(135:#1)$) rectangle ($(#3.south east)+(-45:#1)$); } %group lateral borders %#1-space between node and grouping line. Default=0 %#2-top left node %#3-bottom right node \newcommand{\implicantcostats}[3][0]{ \draw[rounded corners=3pt] ($(rf.east |- #2.north)+(90:#1)$)-| ($(#2.east)+(0:#1)$) |- ($(rf.east |- #3.south)+(-90:#1)$); \draw[rounded corners=3pt] ($(cf.west |- #2.north)+(90:#1)$) -| ($(#3.west)+(180:#1)$) |- ($(cf.west |- #3.south)+(-90:#1)$); } %group top-bottom borders %#1-space between node and grouping line. Default=0 %#2-top left node %#3-bottom right node \newcommand{\implicantdaltbaix}[3][0]{ \draw[rounded corners=3pt] ($(cf.south -| #2.west)+(180:#1)$) |- ($(#2.south)+(-90:#1)$) -| ($(cf.south -| #3.east)+(0:#1)$); \draw[rounded corners=3pt] ($(rf.north -| #2.west)+(180:#1)$) |- ($(#3.north)+(90:#1)$) -| ($(rf.north -| #3.east)+(0:#1)$); } %group corners %#1-space between node and grouping line. Default=0 \newcommand{\implicantcantons}[1][0]{ \draw[rounded corners=3pt] ($(rf.east |- 0.south)+(-90:#1)$) -| ($(0.east |- cf.south)+(0:#1)$); \draw[rounded corners=3pt] ($(rf.east |- 8.north)+(90:#1)$) -| ($(8.east |- rf.north)+(0:#1)$); \draw[rounded corners=3pt] ($(cf.west |- 2.south)+(-90:#1)$) -| ($(2.west |- cf.south)+(180:#1)$); \draw[rounded corners=3pt] ($(cf.west |- 10.north)+(90:#1)$) -| ($(10.west |- rf.north)+(180:#1)$); } %Empty Karnaugh map 4x4 \newenvironment{Karnaugh}% { \begin{tikzpicture}[baseline=(current bounding box.north),scale=0.8] \draw (0,0) grid (4,4); \draw (0,4) -- node [pos=0.7,above right,anchor=south west] {cd} node [pos=0.7,below left,anchor=north east] {ab} ++(135:1); % \matrix (mapa) [matrix of nodes, column sep={0.8cm,between origins}, row sep={0.8cm,between origins}, every node/.style={minimum size=0.3mm}, anchor=8.center, ampersand replacement=\&] at (0.5,0.5) { \& |(c00)| 00 \& |(c01)| 01 \& |(c11)| 11 \& |(c10)| 10 \& |(cf)| \phantom{00} \\ |(r00)| 00 \& |(0)| \phantom{0} \& |(1)| \phantom{0} \& |(3)| \phantom{0} \& |(2)| \phantom{0} \& \\ |(r01)| 01 \& |(4)| \phantom{0} \& |(5)| \phantom{0} \& |(7)| \phantom{0} \& |(6)| \phantom{0} \& \\ |(r11)| 11 \& |(12)| \phantom{0} \& |(13)| \phantom{0} \& |(15)| \phantom{0} \& |(14)| \phantom{0} \& \\ |(r10)| 10 \& |(8)| \phantom{0} \& |(9)| \phantom{0} \& |(11)| \phantom{0} \& |(10)| \phantom{0} \& \\ |(rf) | \phantom{00} \& \& \& \& \& \\ }; }% { \end{tikzpicture} } %Empty Karnaugh map 2x4 \newenvironment{Karnaughvuit}% { \begin{tikzpicture}[baseline=(current bounding box.north),scale=0.8] \draw (0,0) grid (4,2); \draw (0,2) -- node [pos=0.7,above right,anchor=south west] {bc} node [pos=0.7,below left,anchor=north east] {a} ++(135:1); % \matrix (mapa) [matrix of nodes, column sep={0.8cm,between origins}, row sep={0.8cm,between origins}, every node/.style={minimum size=0.3mm}, anchor=4.center, ampersand replacement=\&] at (0.5,0.5) { \& |(c00)| 00 \& |(c01)| 01 \& |(c11)| 11 \& |(c10)| 10 \& |(cf)| \phantom{00} \\ |(r00)| 0 \& |(0)| \phantom{0} \& |(1)| \phantom{0} \& |(3)| \phantom{0} \& |(2)| \phantom{0} \& \\ |(r01)| 1 \& |(4)| \phantom{0} \& |(5)| \phantom{0} \& |(7)| \phantom{0} \& |(6)| \phantom{0} \& \\ |(rf) | \phantom{00} \& \& \& \& \& \\ }; }% { \end{tikzpicture} } %Defines 8 or 16 values (0,1,X) \newcommand{\contingut}[1]{% \foreach \x [count=\xi from 0] in {#1} \path (\xi) node {\x}; } %Places 1 in listed positions \newcommand{\minterms}[1]{% \foreach \x in {#1} \path (\x) node {1}; } %Places 0 in listed positions \newcommand{\maxterms}[1]{% \foreach \x in {#1} \path (\x) node {0}; } %Places X in listed positions \newcommand{\indeterminats}[1]{% \foreach \x in {#1} \path (\x) node {X}; } \begin{document} \begin{Karnaugh} \contingut{0,0,0,0,0,1,0,1,1,1,0,0,0,1,0,1} \implicant{0}{2} \implicantdaltbaix[3pt]{3}{10} \implicantcostats{4}{14} \end{Karnaugh} \begin{Karnaugh} \minterms{4,10,11,13} \maxterms{1,3,6,7,8,9,12,14} \indeterminats{0,2,5,15} \implicant{4}{5} \implicant{11}{10} \implicant{13}{15} \implicantcostats{0}{2} \implicant[3pt]{0}{4} \implicant[3pt]{5}{13} \implicant[3pt]{15}{11} \implicantdaltbaix[3pt]{2}{10} \end{Karnaugh} \end{document}
\documentclass[varwidth=true, border=2pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} %% helper macros % The 3D code is based on The drawing is based on Tomas M. Trzeciak's % `Stereographic and cylindrical map projections example`: % http://www.texample.net/tikz/examples/map-projections/ \newcommand\pgfmathsinandcos[3]{% \pgfmathsetmacro#1{sin(#3)}% \pgfmathsetmacro#2{cos(#3)}% } \newcommand\LongitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % azimuth \tikzset{#1/.estyle={cm={\cost,\sint*\sinEl,0,\cosEl,(0,0)}}} } \newcommand\LatitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % latitude \pgfmathsetmacro\yshift{\cosEl*\sint} \tikzset{#1/.estyle={cm={\cost,0,0,\cost*\sinEl,(0,\yshift)}}} % } \newcommand\DrawLongitudeCircle[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,thin,black] (\angVis:1) arc (\angVis:\angVis+180:1); \draw[current plane,thin,dashed] (\angVis-180:1) arc (\angVis-180:\angVis:1); }%this is fake: for drawing the grid \newcommand\DrawLongitudeCirclered[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,red,thick] (150:1) arc (150:180:1); }%for drawing the grid \newcommand\DLongredd[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,black,dashed, ultra thick] (150:1) arc (150:180:1); } \newcommand\DLatred[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} \draw[current plane,dashed,black,ultra thick] (-50:1) arc (-50:-35:1); } \newcommand\fillred[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,red,thin] (\angVis:1) arc (\angVis:\angVis+180:1); } \newcommand\DrawLatitudeCircle[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} \draw[current plane,thin,black] (\angVis:1) arc (\angVis:-\angVis-180:1); \draw[current plane,thin,dashed] (180-\angVis:1) arc (180-\angVis:\angVis:1); }%Defining functions to draw limited latitude circles (for the red mesh) \newcommand\DrawLatitudeCirclered[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} %\draw[current plane,red,thick] (-\angVis-50:1) arc (-\angVis-50:-\angVis-20:1); \draw[current plane,red,thick] (-50:1) arc (-50:-35:1); } \tikzset{% >=latex, inner sep=0pt,% outer sep=2pt,% mark coordinate/.style={inner sep=0pt,outer sep=0pt,minimum size=3pt, fill=black,circle}% } \usepackage{amsmath} \usetikzlibrary{arrows} \pagestyle{empty} \usepackage{pgfplots} \usetikzlibrary{calc,fadings,decorations.pathreplacing} \begin{document} \begin{tikzpicture}[scale=1,every node/.style={minimum size=1cm}] %% some definitions \def\R{4} % sphere radius \def\angEl{25} % elevation angle \def\angAz{-100} % azimuth angle \def\angPhiOne{-50} % longitude of point P \def\angPhiTwo{-35} % longitude of point Q \def\angBeta{30} % latitude of point P and Q %% working planes \pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole \LongitudePlane[xzplane]{\angEl}{\angAz} \LongitudePlane[pzplane]{\angEl}{\angPhiOne} \LongitudePlane[qzplane]{\angEl}{\angPhiTwo} \LatitudePlane[equator]{\angEl}{0} \fill[ball color=white!10] (0,0) circle (\R); % 3D lighting effect \coordinate (O) at (0,0); \coordinate[mark coordinate] (N) at (0,\H); \coordinate[mark coordinate] (S) at (0,-\H); \path[xzplane] (\R,0) coordinate (XE); %defining points outsided the area bounded by the sphere \path[qzplane] (\angBeta:\R+5.2376) coordinate (XEd); \path[pzplane] (\angBeta:\R) coordinate (P);%fino alla sfera \path[pzplane] (\angBeta:\R+5.2376) coordinate (Pd);%sfora di una quantità pari a 10 dopo la sfera \path[pzplane] (\angBeta:\R+5.2376) coordinate (Td);%sfora di una quantità pari a 10 dopo la sfera \path[pzplane] (\R,0) coordinate (PE); \path[pzplane] (\R+4,0) coordinate (PEd); \path[qzplane] (\angBeta:\R) coordinate (Q); \path[qzplane] (\angBeta:\R) coordinate (Qd);%sfora di una quantità pari a 10 dopo la sfera \path[qzplane] (\R,0) coordinate (QE); \path[qzplane] (\R+4,0) coordinate (QEd);%sfora di una quantità 10 dalla sfera sul piano equat. \DrawLongitudeCircle[\R]{\angPhiOne} % pzplane \DrawLongitudeCircle[\R]{\angPhiTwo} % qzplane \DrawLatitudeCircle[\R]{\angBeta} \DrawLatitudeCircle[\R]{0} % equator %labelling north and south \node[above=8pt] at (N) {$\mathbf{N}$}; \node[below=8pt] at (S) {$\mathbf{S}$}; \draw[-,dashed, thick] (N) -- (S); \draw[->] (O) -- (P); \draw[dashed] (XE) -- (O) -- (PE); \draw[dashed] (O) -- (QE); \draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15] node[midway,right] {$v$} (\angBeta:0.5*\R); \path[pzplane] (0.5*\angBeta:\R) node[right] {$$}; \path[qzplane] (0.5*\angBeta:\R) node[right] {$$}; \draw[equator,->,thin] (\angAz:0.5*\R) to[bend right=30] node[pos=0.4,above] {$u$} (\angPhiOne:0.5*\R); \end{tikzpicture} \end{document}
\documentclass{article} % Load the TikZ package \usepackage{tikz} % Define the number of teeth on the gear \def\noteeth{16} % Define the radius of the gear \def\gearradius{2cm} % Define the radius of the circle that circumscribes the gear \def\circumradius{\gearradius*1.2} % Define the angle between each tooth \pgfmathsetmacro{\toothangle}{360/\noteeth} % Define the angle between each half-tooth \pgfmathsetmacro{\halftoothangle}{\toothangle/2} % Define the angle between each tooth tip \pgfmathsetmacro{\tiptoothangle}{\toothangle/4} % Define the angle between each tooth valley \pgfmathsetmacro{\valleytoothangle}{\toothangle/4} % Define the angle between each half-tooth tip \pgfmathsetmacro{\halftoothtiptangle}{\halftoothangle/2} % Define the angle between each half-tooth valley \pgfmathsetmacro{\halftoothvalleyangle}{\halftoothangle/2} % Define the angle between each half-tooth slope \pgfmathsetmacro{\halftoothslopeangle}{\halftoothangle/4} % Define the angle between each tooth slope \pgfmathsetmacro{\toothslopeangle}{\toothangle/8} % Define the angle between each tooth slope and the horizontal \pgfmathsetmacro{\toothslopehorizontalangle}{90-\toothslopeangle} % Define the angle between each half-tooth slope and the horizontal \pgfmathsetmacro{\halftoothslopehorizontalangle}{90-\halftoothslopeangle} % Define the angle between each half-tooth tip slope and the horizontal \pgfmathsetmacro{\halftoothtiphorizontalangle}{90-\tiptoothangle} % Define the angle between each half-tooth valley slope and the horizontal \pgfmathsetmacro{\halftoothvalleyhorizontalangle}{90-\valleytoothangle} % Define the angle between each tooth valley slope and the horizontal \pgfmathsetmacro{\toothvalleyhorizontalangle}{90-\valleytoothangle} % Define the angle between each tooth tip slope and the horizontal \pgfmathsetmacro{\toothtiphorizontalangle}{90-\tiptoothangle} % Define the angle between each tooth slope and the vertical \pgfmathsetmacro{\toothslopeverticalangle}{\toothangle/8} % Define the angle between each half-tooth slope and the vertical \pgfmathsetmacro{\halftoothslopeverticalangle}{\halftoothangle/4} % Define the angle between each half-tooth tip slope and the vertical \pgfmathsetmacro{\halftoothtipverticalangle}{\tiptoothangle/2} % Define the angle between each half-tooth valley slope and the vertical \pgfmathsetmacro{\halftoothvalleyverticalangle}{\valleytoothangle/2} % Define the angle between each tooth valley slope and the vertical \pgfmathsetmacro{\toothvalleyverticalangle}{\valleytoothangle/2} % Define the angle between each tooth tip slope and the vertical \pgfmathsetmacro{\toothtipverticalangle}{\tiptoothangle/2} % Define the angle between each half-tooth slope and the horizontal for the inner circle \pgfmathsetmacro{\halftoothslopehorizontalangleinner}{90+\halftoothslopeangle} % Define the angle between each half-tooth tip slope and the horizontal for the inner circle \pgfmathsetmacro{\halftoothtiphorizontalangleinner}{90+\tiptoothangle} % Define the angle between each half-tooth valley slope and the horizontal for the inner circle \pgfmathsetmacro{\halftoothvalleyhorizontalangleinner}{90+\valleytoothangle} % Define the angle between each tooth valley slope and the horizontal for the inner circle \pgfmathsetmacro{\toothvalleyhorizontalangleinner}{90+\valleytoothangle} % Define the angle between each tooth tip slope and the horizontal for the inner circle \pgfmathsetmacro{\toothtiphorizontalangleinner}{90+\tiptoothangle} % Define the angle between each half-tooth slope and the vertical for the inner circle \pgfmathsetmacro{\halftoothslopeverticalangleinner}{-\halftoothangle/4} % Define the angle between each half-tooth tip slope and the vertical for the inner circle \pgfmathsetmacro{\halftoothtipverticalangleinner}{-\tiptoothangle/2} % Define the angle between each half-tooth valley slope and the vertical for the inner circle \pgfmathsetmacro{\halftoothvalleyverticalangleinner}{-\valleytoothangle/2} % Define the angle between each tooth valley slope and the vertical for the inner circle \pgfmathsetmacro{\toothvalleyverticalangleinner}{-\valleytoothangle/2} % Define the angle between each tooth tip slope and the vertical for the inner circle \pgfmathsetmacro{\toothtipverticalangleinner}{-\tiptoothangle/2} % Define the angle between each half-tooth slope and the horizontal for the outer circle \pgfmathsetmacro{\halftoothslopehorizontalangleouter}{90-\halftoothslopeangle} % Define the angle between each half-tooth tip slope and the horizontal for the outer circle \pgfmathsetmacro{\halftoothtiphorizontalangleouter}{90-\tiptoothangle} % Define the angle between each half-tooth valley slope and the horizontal for the outer circle \pgfmathsetmacro{\halftoothvalleyhorizontalangleouter}{90-\valleytoothangle} % Define the angle between each tooth valley slope and the horizontal for the outer circle \pgfmathsetmacro{\toothvalleyhorizontalangleouter}{90-\valleytoothangle} % Define the angle between each tooth tip slope and the horizontal for the outer circle \pgfmathsetmacro{\toothtiphorizontalangleouter}{90-\tiptoothangle} % Define the angle between each half-tooth slope and the vertical for the outer circle \pgfmathsetmacro{\halftoothslopeverticalangleouter}{\halftoothangle/4} % Define the angle between each half-tooth tip slope and the vertical for the outer circle \pgfmathsetmacro{\halftoothtipverticalangleouter}{\tiptoothangle/2} % Define the angle between each half-tooth valley slope and the vertical for the outer circle \pgfmathsetmacro{\halftoothvalleyverticalangleouter}{\valleytoothangle/2} % Define the angle between each tooth valley slope and the vertical for the outer circle \pgfmathsetmacro{\toothvalleyverticalangleouter}{\valleytoothangle/2} % Define the angle between each tooth tip slope and the vertical for the outer circle \pgfmathsetmacro{\toothtipverticalangleouter}{\tiptoothangle/2} % Define the gear \begin{document} \begin{tikzpicture} % Draw the outer circle \draw (0,0) circle (\circumradius); % Draw the teeth \foreach \i in {1,...,\noteeth} { % Draw the tooth slope \draw[thick] ({(\i-1)*\toothangle+\toothslopeangle}:\gearradius) -- ({(\i-1)*\toothangle+\toothslopehorizontalangle}:{\gearradius+\toothslopeverticalangle}) -- ({\i*\toothangle-\toothslopeangle}:\gearradius) -- ({\i*\toothangle-\toothslopehorizontalangle}:{\gearradius+\toothslopeverticalangle}) -- cycle; % Draw the tooth tip \draw[thick] ({\i*\toothangle-\tiptoothangle}:\gearradius) -- ({\i*\toothangle-\toothtiphorizontalangle}:{\gearradius+\toothtipverticalangle}) -- ({\i*\toothangle}:\gearradius) -- ({\i*\toothangle+\toothtiphorizontalangle}:{\gearradius+\toothtipverticalangle}) -- cycle; % Draw the tooth valley \draw[thick] ({\i*\toothangle-\valleytoothangle}:\gearradius) -- ({\i*\toothangle-\toothvalleyhorizontalangle}:{\gearradius-\toothvalleyverticalangle}) -- ({\i*\toothangle}:\gearradius) -- ({\i*\toothangle+\toothvalleyhorizontalangle}:{\gearradius-\toothvalleyverticalangle}) -- cycle; % Draw the half-tooth slope \draw[thick] ({(\i-1)*\toothangle+\halftoothangle+\halftoothslopeangle}:\gearradius) -- ({(\i-1)*\toothangle+\halftoothslopehorizontalangle}:{\gearradius+\halftoothslopeverticalangle}) -- ({\i*\toothangle-\halftoothangle-\halftoothslopeangle}:\gearradius) -- ({\i*\toothangle-\halftoothslopehorizontalangle}:{\gearradius+\halftoothslopeverticalangle}) -- cycle; % Draw the half-tooth tip \draw[thick] ({\i*\toothangle-\halftoothangle-\halftoothtiptangle}:\gearradius) -- ({\i*\toothangle-\halftoothtiphorizontalangle}:{\gearradius+\halftoothtipverticalangle}) -- ({\i*\toothangle-\halftoothangle}:\gearradius) -- ({\i*\toothangle-\halftoothangle+\halftoothtiphorizontalangle}:{\gearradius+\halftoothtipverticalangle}) -- cycle; % Draw the half-tooth valley \draw[thick] ({\i*\toothangle-\halftoothangle-\halftoothvalleyangle}:\gearradius) -- ({\i*\toothangle-\halftoothvalleyhorizontalangle}:{\gearradius-\halftoothvalleyverticalangle}) -- ({\i*\toothangle-\halftoothangle}:\gearradius) -- ({\i*\toothangle-\halftoothangle+\halftoothvalleyhorizontalangle}:{\gearradius-\halftoothvalleyverticalangle}) -- cycle; % Draw the inner half-tooth slope \draw[thick] ({(\i-1)*\toothangle+\halftoothangle+\halftoothslopeangle}:\gearradius/2) -- ({(\i-1)*\toothangle+\halftoothslopehorizontalangleinner}:{\gearradius/2+\halftoothslopeverticalangleinner}) -- ({\i*\toothangle-\halftoothangle-\halftoothslopeangle}:\gearradius/2) -- ({\i*\toothangle-\halftoothslopehorizontalangleinner}:{\gearradius/2+\halftoothslopeverticalangleinner}) -- cycle; % Draw the inner half-tooth tip \draw[thick] ({\i*\toothangle-\halftoothangle-\halftoothtiptangle}:\gearradius/2) -- ({\i*\toothangle-\halftoothtiphorizontalangleinner}:{\gearradius/2+\halftoothtipverticalangleinner}) -- ({\i*\toothangle-\halftoothangle}:\gearradius/2) -- ({\i*\toothangle-\halftoothangle+\halftoothtiphorizontalangleinner}:{\gearradius/2+\halftoothtipverticalangleinner}) -- cycle; % Draw the inner half-tooth valley \draw[thick] ({\i*\toothangle-\halftoothangle-\halftoothvalleyangle}:\gearradius/2) -- ({\i*\toothangle-\halftoothvalleyhorizontalangleinner}:{\gearradius/2-\halftoothvalleyverticalangleinner}) -- ({\i*\toothangle-\halftoothangle}:\gearradius/2) -- ({\i*\toothangle-\halftoothangle+\halftoothvalleyhorizontalangleinner}:{\gearradius/2-\halftoothvalleyverticalangleinner}) -- cycle; % Draw the outer half-tooth slope \draw[thick] ({(\i-1)*\toothangle+\halftoothangle+\halftoothslopeangle}:\gearradius*1.5) -- ({(\i-1)*\toothangle+\halftoothslopehorizontalangleouter}:{\gearradius*1.5+\halftoothslopeverticalangleouter}) -- ({\i*\toothangle-\halftoothangle-\halftoothslopeangle}:\gearradius*1.5) -- ({\i*\toothangle-\halftoothslopehorizontalangleouter}:{\gearradius*1.5+\halftoothslopeverticalangleouter}) -- cycle; % Draw the outer half-tooth tip \draw[thick] ({\i*\toothangle-\halftoothangle-\halftoothtiptangle}:\gearradius*1.5) -- ({\i*\toothangle-\halftoothtiphorizontalangleouter}:{\gearradius*1.5+\halftoothtipverticalangleouter}) -- ({\i*\toothangle-\halftoothangle}:\gearradius*1.5) -- ({\i*\toothangle-\halftoothangle+\halftoothtiphorizontalangleouter}:{\gearradius*1.5+\halftoothtipverticalangleouter}) -- cycle; % Draw the outer half-tooth valley \draw[thick] ({\i*\toothangle-\halftoothangle-\halftoothvalleyangle}:\gearradius*1.5) -- ({\i*\toothangle-\halftoothvalleyhorizontalangleouter}:{\gearradius*1.5-\halftoothvalleyverticalangleouter}) -- ({\i*\toothangle-\halftoothangle}:\gearradius*1.5) -- ({\i*\toothangle-\halftoothangle+\halftoothvalleyhorizontalangleouter}:{\gearradius*1.5-\halftoothvalleyverticalangleouter}) -- cycle; } \end{tikzpicture} \end{document}
\documentclass{article} % Load TikZ package \usepackage{tikz} % Define toilet dimensions \def\toiletwidth{4} \def\toiletdepth{3} \def\toiletseatheight{1.5} \def\toiletbowllength{2.5} \def\toiletbowlwidth{1.5} % Define toilet color \definecolor{toiletcolor}{RGB}{255, 255, 255} % Define toilet seat color \definecolor{toiletseatcolor}{RGB}{200, 200, 200} % Define toilet bowl color \definecolor{toiletbowlcolor}{RGB}{220, 220, 220} % Define toilet tank color \definecolor{toilettankcolor}{RGB}{200, 200, 200} % Define toilet flush handle color \definecolor{flushhandlecolor}{RGB}{150, 150, 150} % Define toilet paper roll color \definecolor{toiletpapercolor}{RGB}{255, 255, 255} % Define toilet paper roll dimensions \def\toiletpaperwidth{0.5} \def\toiletpaperlength{4} % Define toilet paper roll position \def\toiletpaperx{0.5} \def\toiletpapery{0.5} % Define flush handle dimensions \def\flushhandlewidth{0.2} \def\flushhandlelength{0.8} % Define flush handle position \def\flushhandlex{3.5} \def\flushhandley{1.5} % Define toilet tank dimensions \def\toilettankwidth{1.5} \def\toilettankheight{2} \def\toilettankdepth{1} % Define toilet tank position \def\toilettankx{0.5} \def\toilettanky{2} % Define toilet bowl position \def\toiletbowlx{0} \def\toiletbowly{0} % Define toilet seat position \def\toiletseatx{0} \def\toiletseaty{\toiletseatheight} % Define toilet dimensions \def\toiletwidth{4} \def\toiletdepth{3} \def\toiletseatheight{1.5} \def\toiletbowllength{2.5} \def\toiletbowlwidth{1.5} % Define toilet color \definecolor{toiletcolor}{RGB}{255, 255, 255} % Define toilet seat color \definecolor{toiletseatcolor}{RGB}{200, 200, 200} % Define toilet bowl color \definecolor{toiletbowlcolor}{RGB}{220, 220, 220} % Define toilet tank color \definecolor{toilettankcolor}{RGB}{200, 200, 200} % Define toilet flush handle color \definecolor{flushhandlecolor}{RGB}{150, 150, 150} % Define toilet paper roll color \definecolor{toiletpapercolor}{RGB}{255, 255, 255} % Define toilet paper roll dimensions \def\toiletpaperwidth{0.5} \def\toiletpaperlength{4} % Define toilet paper roll position \def\toiletpaperx{0.5} \def\toiletpapery{0.5} % Define flush handle dimensions \def\flushhandlewidth{0.2} \def\flushhandlelength{0.8} % Define flush handle position \def\flushhandlex{3.5} \def\flushhandley{1.5} % Define toilet tank dimensions \def\toilettankwidth{1.5} \def\toilettankheight{2} \def\toilettankdepth{1} % Define toilet tank position \def\toilettankx{0.5} \def\toilettanky{2} % Define toilet bowl dimensions \def\toiletbowlwidth{1.5} \def\toiletbowllength{2.5} \def\toiletbowlheight{1} % Define toilet bowl position \def\toiletbowlx{0} \def\toiletbowly{0} % Define toilet seat dimensions \def\toiletseatwidth{2.5} \def\toiletseatdepth{1.5} % Define toilet seat position \def\toiletseatx{0.75} \def\toiletseaty{1.5} % Define toilet paper roll dimensions \def\toiletpaperwidth{0.5} \def\toiletpaperlength{4} % Define toilet paper roll position \def\toiletpaperx{0.5} \def\toiletpapery{0.5} % Define flush handle dimensions \def\flushhandlewidth{0.2} \def\flushhandlelength{0.8} % Define flush handle position \def\flushhandlex{3.5} \def\flushhandley{1.5} % Define toilet tank dimensions \def\toilettankwidth{1.5} \def\toilettankheight{2} \def\toilettankdepth{1} % Define toilet tank position \def\toilettankx{0.5} \def\toilettanky{2} % Define toilet bowl dimensions \def\toiletbowlwidth{1.5} \def\toiletbowllength{2.5} \def\toiletbowlheight{1} % Define toilet bowl position \def\toiletbowlx{0} \def\toiletbowly{0} % Define toilet seat dimensions \def\toiletseatwidth{2.5} \def\toiletseatdepth{1.5} % Define toilet seat position \def\toiletseatx{0.75} \def\toiletseaty{1.5} % Define toilet paper roll dimensions \def\toiletpaperwidth{0.5} \def\toiletpaperlength{4} % Define toilet paper roll position \def\toiletpaperx{0.5} \def\toiletpapery{0.5} % Define flush handle dimensions \def\flushhandlewidth{0.2} \def\flushhandlelength{0.8} % Define flush handle position \def\flushhandlex{3.5} \def\flushhandley{1.5} % Define toilet tank dimensions \def\toilettankwidth{1.5} \def\toilettankheight{2} \def\toilettankdepth{1} % Define toilet tank position \def\toilettankx{0.5} \def\toilettanky{2} % Define toilet bowl dimensions \def\toiletbowlwidth{1.5} \def\toiletbowllength{2.5} \def\toiletbowlheight{1} % Define toilet bowl position \def\toiletbowlx{0} \def\toiletbowly{0} % Define toilet seat dimensions \def\toiletseatwidth{2.5} \def\toiletseatdepth{1.5} % Define toilet seat position \def\toiletseatx{0.75} \def\toiletseaty{1.5} % Define toilet paper roll dimensions \def\toiletpaperwidth{0.5} \def\toiletpaperlength{4} % Define toilet paper roll position \def\toiletpaperx{0.5} \def\toiletpapery{0.5} % Define flush handle dimensions \def\flushhandlewidth{0.2} \def\flushhandlelength{0.8} % Define flush handle position \def\flushhandlex{3.5} \def\flushhandley{1.5} \begin{document} % Create TikZ picture environment \begin{tikzpicture} % Draw toilet tank \fill[toilettankcolor] (\toilettankx, \toilettanky) rectangle ++(\toilettankwidth, \toilettankheight) node[midway] {\tiny TANK}; % Draw toilet bowl \fill[toiletbowlcolor] (\toiletbowlx, \toiletbowly) rectangle ++(\toiletbowlwidth, \toiletbowllength) node[midway] {\tiny BOWL}; % Draw toilet seat \fill[toiletseatcolor] (\toiletseatx, \toiletseaty) rectangle ++(\toiletseatwidth, \toiletseatdepth) node[midway] {\tiny SEAT}; % Draw flush handle \fill[flushhandlecolor] (\flushhandlex, \flushhandley) rectangle ++(\flushhandlewidth, \flushhandlelength) node[midway] {\tiny FLUSH}; % Draw toilet paper roll \fill[toiletpapercolor] (\toiletpaperx, \toiletpapery) rectangle ++(\toiletpaperwidth, \toiletpaperlength) node[midway] {\tiny PAPER}; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=0.5] % Draw the accordion folds \draw[thick] (0,0) -- (0,8) -- (1,8) -- (1,0) -- cycle; \draw[thick] (1,0) -- (1,8) -- (2,8) -- (2,0) -- cycle; \draw[thick] (2,0) -- (2,8) -- (3,8) -- (3,0) -- cycle; \draw[thick] (3,0) -- (3,8) -- (4,8) -- (4,0) -- cycle; \draw[thick] (4,0) -- (4,8) -- (5,8) -- (5,0) -- cycle; \draw[thick] (5,0) -- (5,8) -- (6,8) -- (6,0) -- cycle; \draw[thick] (6,0) -- (6,8) -- (7,8) -- (7,0) -- cycle; \draw[thick] (7,0) -- (7,8) -- (8,8) -- (8,0) -- cycle; \draw[thick] (8,0) -- (8,8) -- (9,8) -- (9,0) -- cycle; \draw[thick] (9,0) -- (9,8) -- (10,8) -- (10,0) -- cycle; \draw[thick] (10,0) -- (10,8) -- (11,8) -- (11,0) -- cycle; \draw[thick] (11,0) -- (11,8) -- (12,8) -- (12,0) -- cycle; \draw[thick] (12,0) -- (12,8) -- (13,8) -- (13,0) -- cycle; \draw[thick] (13,0) -- (13,8) -- (14,8) -- (14,0) -- cycle; \draw[thick] (14,0) -- (14,8) -- (15,8) -- (15,0) -- cycle; \draw[thick] (15,0) -- (15,8) -- (16,8) -- (16,0) -- cycle; \draw[thick] (16,0) -- (16,8) -- (17,8) -- (17,0) -- cycle; \draw[thick] (17,0) -- (17,8) -- (18,8) -- (18,0) -- cycle; \draw[thick] (18,0) -- (18,8) -- (19,8) -- (19,0) -- cycle; \draw[thick] (19,0) -- (19,8) -- (20,8) -- (20,0) -- cycle; \draw[thick] (20,0) -- (20,8) -- (21,8) -- (21,0) -- cycle; \draw[thick] (21,0) -- (21,8) -- (22,8) -- (22,0) -- cycle; \draw[thick] (22,0) -- (22,8) -- (23,8) -- (23,0) -- cycle; \draw[thick] (23,0) -- (23,8) -- (24,8) -- (24,0) -- cycle; \draw[thick] (24,0) -- (24,8) -- (25,8) -- (25,0) -- cycle; \draw[thick] (25,0) -- (25,8) -- (26,8) -- (26,0) -- cycle; \draw[thick] (26,0) -- (26,8) -- (27,8) -- (27,0) -- cycle; \draw[thick] (27,0) -- (27,8) -- (28,8) -- (28,0) -- cycle; \draw[thick] (28,0) -- (28,8) -- (29,8) -- (29,0) -- cycle; \draw[thick] (29,0) -- (29,8) -- (30,8) -- (30,0) -- cycle; \draw[thick] (30,0) -- (30,8) -- (31,8) -- (31,0) -- cycle; \draw[thick] (31,0) -- (31,8) -- (32,8) -- (32,0) -- cycle; \draw[thick] (32,0) -- (32,8) -- (33,8) -- (33,0) -- cycle; \draw[thick] (33,0) -- (33,8) -- (34,8) -- (34,0) -- cycle; \draw[thick] (34,0) -- (34,8) -- (35,8) -- (35,0) -- cycle; \draw[thick] (35,0) -- (35,8) -- (36,8) -- (36,0) -- cycle; \draw[thick] (36,0) -- (36,8) -- (37,8) -- (37,0) -- cycle; \draw[thick] (37,0) -- (37,8) -- (38,8) -- (38,0) -- cycle; \draw[thick] (38,0) -- (38,8) -- (39,8) -- (39,0) -- cycle; \draw[thick] (39,0) -- (39,8) -- (40,8) -- (40,0) -- cycle; \draw[thick] (40,0) -- (40,8) -- (41,8) -- (41,0) -- cycle; \draw[thick] (41,0) -- (41,8) -- (42,8) -- (42,0) -- cycle; \draw[thick] (42,0) -- (42,8) -- (43,8) -- (43,0) -- cycle; \draw[thick] (43,0) -- (43,8) -- (44,8) -- (44,0) -- cycle; \draw[thick] (44,0) -- (44,8) -- (45,8) -- (45,0) -- cycle; \draw[thick] (45,0) -- (45,8) -- (46,8) -- (46,0) -- cycle; \draw[thick] (46,0) -- (46,8) -- (47,8) -- (47,0) -- cycle; \draw[thick] (47,0) -- (47,8) -- (48,8) -- (48,0) -- cycle; \draw[thick] (48,0) -- (48,8) -- (49,8) -- (49,0) -- cycle; \draw[thick] (49,0) -- (49,8) -- (50,8) -- (50,0) -- cycle; \draw[thick] (50,0) -- (50,8) -- (51,8) -- (51,0) -- cycle; \draw[thick] (51,0) -- (51,8) -- (52,8) -- (52,0) -- cycle; \draw[thick] (52,0) -- (52,8) -- (53,8) -- (53,0) -- cycle; \draw[thick] (53,0) -- (53,8) -- (54,8) -- (54,0) -- cycle; \draw[thick] (54,0) -- (54,8) -- (55,8) -- (55,0) -- cycle; \draw[thick] (55,0) -- (55,8) -- (56,8) -- (56,0) -- cycle; \draw[thick] (56,0) -- (56,8) -- (57,8) -- (57,0) -- cycle; \draw[thick] (57,0) -- (57,8) -- (58,8) -- (58,0) -- cycle; \draw[thick] (58,0) -- (58,8) -- (59,8) -- (59,0) -- cycle; \draw[thick] (59,0) -- (59,8) -- (60,8) -- (60,0) -- cycle; \draw[thick] (60,0) -- (60,8) -- (61,8) -- (61,0) -- cycle; \draw[thick] (61,0) -- (61,8) -- (62,8) -- (62,0) -- cycle; \draw[thick] (62,0) -- (62,8) -- (63,8) -- (63,0) -- cycle; \draw[thick] (63,0) -- (63,8) -- (64,8) -- (64,0) -- cycle; \draw[thick] (64,0) -- (64,8) -- (65,8) -- (65,0) -- cycle; \draw[thick] (65,0) -- (65,8) -- (66,8) -- (66,0) -- cycle; \draw[thick] (66,0) -- (66,8) -- (67,8) -- (67,0) -- cycle; \draw[thick] (67,0) -- (67,8) -- (68,8) -- (68,0) -- cycle; \draw[thick] (68,0) -- (68,8) -- (69,8) -- (69,0) -- cycle; \draw[thick] (69,0) -- (69,8) -- (70,8) -- (70,0) -- cycle; \draw[thick] (70,0) -- (70,8) -- (71,8) -- (71,0) -- cycle; \draw[thick] (71,0) -- (71,8) -- (72,8) -- (72,0) -- cycle; \draw[thick] (72,0) -- (72,8) -- (73,8) -- (73,0) -- cycle; \draw[thick] (73,0) -- (73,8) -- (74,8) -- (74,0) -- cycle; \draw[thick] (74,0) -- (74,8) -- (75,8) -- (75,0) -- cycle; \draw[thick] (75,0) -- (75,8) -- (76,8) -- (76,0) -- cycle; \draw[thick] (76,0) -- (76,8) -- (77,8) -- (77,0) -- cycle; \draw[thick] (77,0) -- (77,8) -- (78,8) -- (78,0) -- cycle; \draw[thick] (78,0) -- (78,8) -- (79,8) -- (79,0) -- cycle; \draw[thick] (79,0) -- (79,8) -- (80,8) -- (80,0) -- cycle; \draw[thick] (80,0) -- (80,8) -- (81,8) -- (81,0) -- cycle; \draw[thick] (81,0) -- (81,8) -- (82,8) -- (82,0) -- cycle; \draw[thick] (82,0) -- (82,8) -- (83,8) -- (83,0) -- cycle; \draw[thick] (83,0) -- (83,8) -- (84,8) -- (84,0) -- cycle; \draw[thick] (84,0) -- (84,8) -- (85,8) -- (85,0) -- cycle; \draw[thick] (85,0) -- (85,8) -- (86,8) -- (86,0) -- cycle; \draw[thick] (86,0) -- (86,8) -- (87,8) -- (87,0) -- cycle; \draw[thick] (87,0) -- (87,8) -- (88,8) -- (88,0) -- cycle; \draw[thick] (88,0) -- (88,8) -- (89,8) -- (89,0) -- cycle; \draw[thick] (89,0) -- (89,8) -- (90,8) -- (90,0) -- cycle; \draw[thick] (90,0) -- (90,8) -- (91,8) -- (91,0) -- cycle; \draw[thick] (91,0) -- (91,8) -- (92,8) -- (92,0) -- cycle; \draw[thick] (92,0) -- (92,8) -- (93,8) -- (93,0) -- cycle; \draw[thick] (93,0) -- (93,8) -- (94,8) -- (94,0) -- cycle; \draw[thick] (94,0) -- (94,8) -- (95,8) -- (95,0) -- cycle; \draw[thick] (95,0) -- (95,8) -- (96,8) -- (96,0) -- cycle; \draw[thick] (96,0) -- (96,8) -- (97,8) -- (97,0) -- cycle; \draw[thick] (97,0) -- (97,8) -- (98,8) -- (98,0) -- cycle; \draw[thick] (98,0) -- (98,8) -- (99,8) -- (99,0) -- cycle; \draw[thick] (99,0) -- (99,8) -- (100,8) -- (100,0) -- cycle; \end{tikzpicture} \end{document}
\documentclass[a5paper]{article} \usepackage{ifthen} \usepackage{tikz} \usetikzlibrary{calc} \pgfkeys{ /sevenseg/.is family, /sevenseg, slant/.estore in = \sevensegSlant, % vertical slant in degrees size/.estore in = \sevensegSize, % length of a segment shrink/.estore in = \sevensegShrink, % avoids overlapping of segments line width/.estore in = \sevensegLinewidth, % thickness of the segments line cap/.estore in = \sevensegLinecap, % end cap style rect, round, butt oncolor/.estore in = \sevensegOncolor, % color of an ON segment offcolor/.estore in = \sevensegOffcolor, % color of an OFF segment } \pgfkeys{ /sevenseg, default/.style = {slant = 0, size = 1em, shrink = 0.1, line width = 0.15em, line cap = butt, oncolor = red, offcolor = gray} } %=============================================== % a b c d e f g - segment values % \sevenseg[options]{{1,1,1,1,1,1,0,}} % \newcommand{\sevenseg}[2][]% options values {% \pgfkeys{/sevenseg, default, #1}% \def\sevensegarray{#2}% \begin{tikzpicture}% % first define the position of the 6 corner points \path (0,0) ++(0,0) coordinate (P1); \path (0,0) ++(\sevensegSize,0) coordinate (P2); \path (0,0) ++(90-\sevensegSlant:\sevensegSize) coordinate (P3); \path (P2) ++(90-\sevensegSlant:\sevensegSize) coordinate (P4); \path (P3) ++(90-\sevensegSlant:\sevensegSize) coordinate (P5); \path (P4) ++(90-\sevensegSlant:\sevensegSize) coordinate (P6); % then step through the 1/0 values in the segment array \foreach \i in {0,...,6}% { \pgfmathparse{\sevensegarray[\i]} \ifthenelse{\equal{\pgfmathresult}{1}}% {\let\mycolor=\sevensegOncolor}% segment is on {\let\mycolor=\sevensegOffcolor}% segment is off \tikzstyle{segstyle} = [draw=\mycolor, line width = \sevensegLinewidth, line cap = \sevensegLinecap] %----------------------- \ifthenelse{\equal{\i}{0}}{\path[segstyle] (${1-\sevensegShrink}*(P5)+\sevensegShrink*(P6)$) -- ($\sevensegShrink*(P5)+{1-\sevensegShrink}*(P6)$);}{} % a \ifthenelse{\equal{\i}{1}}{\path[segstyle] (${1-\sevensegShrink}*(P6)+\sevensegShrink*(P4)$) -- ($\sevensegShrink*(P6)+{1-\sevensegShrink}*(P4)$);}{} % b \ifthenelse{\equal{\i}{2}}{\path[segstyle] (${1-\sevensegShrink}*(P4)+\sevensegShrink*(P2)$) -- ($\sevensegShrink*(P4)+{1-\sevensegShrink}*(P2)$);}{} % c \ifthenelse{\equal{\i}{3}}{\path[segstyle] (${1-\sevensegShrink}*(P1)+\sevensegShrink*(P2)$) -- ($\sevensegShrink*(P1)+{1-\sevensegShrink}*(P2)$);}{} % d \ifthenelse{\equal{\i}{4}}{\path[segstyle] (${1-\sevensegShrink}*(P1)+\sevensegShrink*(P3)$) -- ($\sevensegShrink*(P1)+{1-\sevensegShrink}*(P3)$);}{} % e \ifthenelse{\equal{\i}{5}}{\path[segstyle] (${1-\sevensegShrink}*(P3)+\sevensegShrink*(P5)$) -- ($\sevensegShrink*(P3)+{1-\sevensegShrink}*(P5)$);}{} % f \ifthenelse{\equal{\i}{6}}{\path[segstyle] (${1-\sevensegShrink}*(P3)+\sevensegShrink*(P4)$) -- ($\sevensegShrink*(P3)+{1-\sevensegShrink}*(P4)$);}{} % g } \end{tikzpicture}% } \newcommand{\sevensegnum}[2][]% sample characvters {% \ifthenelse{\equal{#2}{0}}{\sevenseg[#1]{{1,1,1,1,1,1,0,}}}{% \ifthenelse{\equal{#2}{1}}{\sevenseg[#1]{{0,1,1,0,0,0,0,}}}{% \ifthenelse{\equal{#2}{2}}{\sevenseg[#1]{{1,1,0,1,1,0,1,}}}{% \ifthenelse{\equal{#2}{3}}{\sevenseg[#1]{{1,1,1,1,0,0,1,}}}{% \ifthenelse{\equal{#2}{4}}{\sevenseg[#1]{{0,1,1,0,0,1,1,}}}{% \ifthenelse{\equal{#2}{5}}{\sevenseg[#1]{{1,0,1,1,0,1,1,}}}{% \ifthenelse{\equal{#2}{6}}{\sevenseg[#1]{{1,0,1,1,1,1,1,}}}{% \ifthenelse{\equal{#2}{7}}{\sevenseg[#1]{{1,1,1,0,0,0,0,}}}{% \ifthenelse{\equal{#2}{8}}{\sevenseg[#1]{{1,1,1,1,1,1,1,}}}{% \ifthenelse{\equal{#2}{9}}{\sevenseg[#1]{{1,1,1,1,0,1,1,}}}{% \ifthenelse{\equal{#2}{A}}{\sevenseg[#1]{{1,1,1,0,1,1,1,}}}{% \ifthenelse{\equal{#2}{B}}{\sevenseg[#1]{{0,0,1,1,1,1,1,}}}{% \ifthenelse{\equal{#2}{C}}{\sevenseg[#1]{{0,0,0,1,1,0,1,}}}{% \ifthenelse{\equal{#2}{D}}{\sevenseg[#1]{{0,1,1,1,1,0,1,}}}{% \ifthenelse{\equal{#2}{E}}{\sevenseg[#1]{{1,0,0,1,1,1,1,}}}{% \ifthenelse{\equal{#2}{F}}{\sevenseg[#1]{{1,0,0,0,1,1,1,}}}{% {\sevenseg[#1]{{0,0,0,0,0,0,0,}}}}}}}}}}}}}}}}}}}% } \begin{document} \begin{center} \foreach \n in {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,' '}% {\sevensegnum[offcolor=white]{\n} } \bigskip \sevenseg[size = 2em, line cap = butt]{{0,1,1,0,0,0,0,}} \sevenseg[size = 2em, line cap = round]{{1,1,0,1,1,0,1,}} \sevenseg[size = 2em, line cap = rect]{{1,1,1,1,1,1,1,}} \sevenseg[size = 2em, slant = 5, shrink = 0, line cap = round, oncolor = green]{{1,1,1,1,0,0,1,}} \bigskip \sevenseg{{1,1,1,1,1,1,1,}} \tikz{\node[inner sep = 0pt, draw = blue] {\sevensegnum{8}}} \tikz{\node[inner sep = 0pt, draw = blue] {\sevensegnum[slant = 20]{8}}} \end{center} \end{document}
\documentclass[]{article} \usepackage{booktabs} \usepackage{tikz} \usetikzlibrary{arrows,positioning,fit,shapes,calc} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % A square shaped arrow % The arrow has been renamed to squarea to avoid conflict with the square arrow % defined in the CVS version of PGF \newdimen\arrowsize \pgfarrowsdeclare{squarea}{squarea} { \arrowsize=0.4pt \advance\arrowsize by.275\pgflinewidth% \pgfarrowsleftextend{+-\arrowsize} \advance\arrowsize by.5\pgflinewidth \pgfarrowsrightextend{+\arrowsize} } { \arrowsize=0.4pt \advance\arrowsize by.275\pgflinewidth% \pgfsetdash{}{+0pt} \pgfsetroundjoin \pgfpathmoveto{\pgfqpoint{1\arrowsize}{4\arrowsize}} \pgfpathlineto{\pgfqpoint{-7\arrowsize}{4\arrowsize}} \pgfpathlineto{\pgfqpoint{-7\arrowsize}{-4\arrowsize}} \pgfpathlineto{\pgfqpoint{1\arrowsize}{-4\arrowsize}} \pgfpathclose \pgfusepathqfillstroke } % A open square shaped arrow \pgfarrowsdeclare{open squarea}{open squarea}%{{-.5bp}{8.5bp}} { \arrowsize=0.4pt \advance\arrowsize by.275\pgflinewidth% \pgfarrowsleftextend{+-.5\pgflinewidth} \advance\arrowsize by7\arrowsize \advance\arrowsize by.5\pgflinewidth \pgfarrowsrightextend{+\arrowsize} } { \arrowsize=0.4pt \advance\arrowsize by.275\pgflinewidth% \pgfsetdash{}{+0pt} \pgfsetroundjoin \pgfpathmoveto{\pgfqpoint{8\arrowsize}{4\arrowsize}} \pgfpathlineto{\pgfqpoint{0\arrowsize}{4\arrowsize}} \pgfpathlineto{\pgfqpoint{0\arrowsize}{-4\arrowsize}} \pgfpathlineto{\pgfqpoint{8\arrowsize}{-4\arrowsize}} \pgfpathclose \pgfusepathqstroke } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % A circle and diamond shape \makeatletter \newdimen\tempa \newdimen\tempb \pgfdeclareshape{diamond in circle}{ \inheritsavedanchors[from=diamond] % this is a diamond \inheritsavedanchors[from=circle] % this is a circle \inheritanchorborder[from=circle] \inheritanchor[from=circle]{center} \inheritanchor[from=circle]{radius} \inheritanchor[from=circle]{north} \inheritanchor[from=circle]{south} \inheritanchor[from=circle]{east} \inheritanchor[from=circle]{west} \inheritanchor[from=circle]{anchorborder} \saveddimen\radius{% % % Caculate ``height radius'' % \pgf@ya=.5\ht\pgfnodeparttextbox% \advance\pgf@ya by.5\dp\pgfnodeparttextbox% \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/inner ysep}}% \advance\pgf@ya by\pgf@yb% % % Caculate ``width radius'' % \pgf@xa=.5\wd\pgfnodeparttextbox% \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/inner xsep}}% \advance\pgf@xa by\pgf@xb% % % Calculate length of radius vector: % \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}% \ifdim\pgf@x>\pgf@y% \c@pgf@counta=\pgf@x% \ifnum\c@pgf@counta=0\relax% \else% \divide\c@pgf@counta by 255\relax% \pgf@xa=16\pgf@xa\relax% \divide\pgf@xa by\c@pgf@counta% \pgf@xa=16\pgf@xa\relax% \fi% \else% \c@pgf@counta=\pgf@y% \ifnum\c@pgf@counta=0\relax% \else% \divide\c@pgf@counta by 255\relax% \pgf@ya=16\pgf@ya\relax% \divide\pgf@ya by\c@pgf@counta% \pgf@xa=16\pgf@ya\relax% \fi% \fi% \pgf@x=\pgf@xa% % % If necessary, adjust radius so that the size requirements are % met: % \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/minimum width}}% \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/minimum height}}% \ifdim\pgf@x<.5\pgf@xb% \pgf@x=.5\pgf@xb% \fi% \ifdim\pgf@x<.5\pgf@yb% \pgf@x=.5\pgf@yb% \fi% % % Now, add larger of outer sepearations. % \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}% \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}% \ifdim\pgf@xb<\pgf@yb% \advance\pgf@x by\pgf@yb% \else% \advance\pgf@x by\pgf@xb% \fi% } \backgroundpath{ \tempa=\radius \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}% \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}% \ifdim\pgf@xb<\pgf@yb% \advance\tempa by-\pgf@yb% \else% \advance\tempa by-\pgf@xb% \fi% \pgfpathmoveto{\centerpoint\advance\pgf@x by\radius}% \pgfpathlineto{\centerpoint\advance\pgf@y by\radius}% \pgfpathlineto{\centerpoint\advance\pgf@x by-\radius}% \pgfpathlineto{\centerpoint\advance\pgf@y by-\radius}% \pgfpathclose% } \behindbackgroundpath{ \tempa=\radius% \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}% \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}% \ifdim\pgf@xb<\pgf@yb% \advance\tempa by-\pgf@yb% \else% \advance\tempa by-\pgf@xb% \fi% \pgfpathcircle{\centerpoint}{\tempa}% } } \makeatother \newcommand{\parameter}[1]{$\langle\mbox{#1}\rangle$} \title{A LaTeX Article} \author{Gabor Tjong A Hung} \begin{document} \tikzset{ every transaction/.style = {fill=white!100}, transaction/.style = {diamond in circle, draw, minimum size=6mm, every transaction}, every actor role/.style = {}, actor role/.style = {rectangle, draw=black!80, ultra thick, minimum size = 6mm, every actor role}, composite actor role/.style = {fill=gray!80, actor role}, elementary actor role/.style = {fill=white!100, actor role}, initiator/.style = {-}, executor/.style = {<-, >=squarea}, system/.style = {rectangle, fill=white!100, ultra thick, draw=black!80, minimum height=60mm, minimum width=4cm,outer sep=0pt}} \begin{figure}[h] \centering \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \begin{tikzpicture}[node distance=1cm, on grid] \begin{pgfonlayer}{background} \node [system] (system) at (0,3){}; \end{pgfonlayer} \node [composite actor role] (CA01) [minimum height=48mm] at ( -4,3) {CA01}; \node [above] at (CA01.north) {Client}; \node [transaction] (T01) at( $(system.south west)!.66!(system.north west)$) {T01} edge [initiator] (CA01.south east |- T01); \node [composite actor role] (CA03) at ( $(system.south)!.66!(system.north)$) {CA03} edge [executor] (T01); \node [above] at (CA03.north) {GDSS facilitator}; \node [transaction] (T02) at ( $(system.south east)!.66!(system.north east)$) {T02} edge [initiator] (CA03); \path (T02)++(2,0) node [composite actor role] (CA02) [minimum height=24mm] {CA02} edge [executor] (T02); \node [above] at (CA02.north) {Participant}; \node [transaction] (T03) at ( $(system.south west)!.33!(system.north west)$) {T03} edge [initiator] (CA01.south east |- T03); \node [composite actor role] (CA04) at ( $(system.south)!.33!(system.north)$) {CA04} edge [executor] (T03); \node [above] at (CA04.north) {GDSS analysist}; \end{tikzpicture} \\[2em] \begin{tabular}{@{T}l@{ }l@{ }p{5cm}} \toprule ID & Transaction Type (T) & Result Type (R)\\ \midrule 01 & Facilitate meeting & Meeting has been facilitated.\\ 02 & Perform Agendum & Agendum has been performed by \parameter{participant} on \parameter{time}.\\ 03 & Analysis & Analysis has been made.\\ \bottomrule \end{tabular}\label{tab:trt_datd} \caption{Global ATD} \end{figure} \end{document}
\documentclass{minimal} \usepackage{tikz} \usetikzlibrary{arrows,calc} \tikzset{ %Define standard arrow tip >=stealth', %Define style for different line styles help lines/.style={dashed, thick}, axis/.style={<->}, important line/.style={thick}, connection/.style={thick, dotted}, } \newcommand\A{\ensuremath{\mathcal{A}}} \newcommand\B{\ensuremath{\mathcal{B}}} \begin{document} \begin{tikzpicture}[scale=1.2] %Draw axis \coordinate (y) at (0,5); \coordinate (x) at (5,0); \draw[axis] (y) -- (0,0) -- (x); %Important coordinates. These are used in both figures and can be %moved to a seperate settings files %% These coordinates deside where boxes start on the y axis \coordinate (alphaas) at ($0.8*(y)$); \coordinate (alphabs) at ($0.533*(y)$); %% These coordinates deside where boxes end on the x axis \coordinate (cfas) at ($.6*(x)$); \coordinate (cfbs) at ($.9*(x)$); %These sets the interest rate lines \coordinate (rl) at ($(cfas)-.2*(x)$); \coordinate (rla) at ($(rl)-.1*(x)$); \coordinate (rlb) at ($(rl)+.1*(x)$); %%%%%%%%%%%%%%%%%%%%%% %We makes some boxes and connect some coordinates %%%%%%%%%%%%%%%%%%%%%% %First, let us draw a line connecting alpha^\A_s og NV^\A_s \draw[important line] let \p1=(alphaas), \p2=(cfas) in (\p1) node[left] {$\alpha_s^\A$} -| (\x2, \y1) -| (\p2) node[below] {$\mathit{NV^\A_s}$}; %Second, let us connect alpha^\B_s og NV^B_s \draw[] let \p1=(alphabs), \p2=(cfbs) in (\p1) node[left] {$\alpha_s^\B$} -| (\x2, \y1) -| (\p2) node[below] {$\mathit{NV^\B_s}$}; %A line seperating the boxes. \draw[help lines] let \p1=(rl), \p2=(y) in (\p1) node[below] {$\hat{r}_L$} -- (\x1, \y2); %%%%%%%%%%%%%%%%%%%%%% %The small boxes will be assinged letter %%%%%%%%%%%%%%%%%%%%%% %%C \draw let \p1=($(alphaas)-(alphabs)$), \p2=(rl), \p3=(alphabs) in ($(.5*\x2, .5*\y1+\y3)$) node {$C$}; %%D \draw let \p1=($(alphaas)-(alphabs)$), \p2=($(cfas)-(rl)$), \p3=(alphabs), \p4=(rl) in ($(.5*\x2+\x4, .5*\y1+\y3)$) node {$D$}; %%E \draw let \p1=(alphabs), \p2=(rl) in ($(.5*\x2, .5*\y1)$) node {$E$}; %%F \draw let \p1=(alphabs), \p2=($(cfas)-(rl)$), \p3=(rl) in ($(.5*\x2+\x3, .5*\y1)$) node {$F$}; %%G \draw let \p1=(alphabs), \p2=($(cfbs)-(cfas)$), \p3=(cfas) in ($(.5*\x2+\x3, .5*\y1)$) node {$G$}; \end{tikzpicture} \quad \begin{tikzpicture}[scale=1.2] %Axis \coordinate (y) at (0,5); \coordinate (x) at (5,0); \draw[axis] (y) -- (0,0) -- (x); %Important coordinates. These are used in both figures and can be %moved to a seperate settings files %% These coordinates deside where boxes start on the y axis \coordinate (alphaas) at ($0.8*(y)$); \coordinate (alphabs) at ($0.533*(y)$); %% These coordinates deside where boxes end on the x axis \coordinate (cfas) at ($.6*(x)$); \coordinate (cfbs) at ($.9*(x)$); %These sets the interest rate lines \coordinate (rl) at ($(cfas)-.2*(x)$); \coordinate (rla) at ($(rl)-.1*(x)$); \coordinate (rlb) at ($(rl)+.1*(x)$); %%%%%%%%%%%%%%%%%%%%%% %We makes some boxes and connect some coordinates %%%%%%%%%%%%%%%%%%%%%% %First, let us draw a line connecting alpha^\A_s og NV^\A_s \draw[important line] let \p1=(alphaas), \p2=(cfas) in (\p1) node[left] {$\alpha_s^\A$} -| (\x2, \y1) -| (\p2) node[below] {$\phantom{N}\mathit{NV^\A_s}$}; %Second, let us connect alpha^\B_s og NV^B_s \draw[] let \p1=(alphabs), \p2=(cfbs) in (\p1) node[left] {$\alpha_s^\B$} -| (\x2, \y1) -| (\p2) node[below] {$\mathit{NV^\B_s}$}; %%%%%%%%%%%%%%%%%%%%%% %Here we need two lines seperating the large boxes %%%%%%%%%%%%%%%%%%%%%% \draw[help lines] let \p1=(rla), \p2=(y) in (\p1) node[below] {$r^\A_L$} -- (\x1, \y2); \draw[connection] let \p1=(rlb), \p2=(y) in (\p1) node[below] {$r^\B_L$} -- (\x1, \y2); %%%%%%%%%%%%%%%%%%%%%% %The small boxes will be assinged letter %%%%%%%%%%%%%%%%%%%%%% %%H \draw let \p1=($(alphaas)-(alphabs)$), \p2=(rla), \p3=(alphabs) in ($(.5*\x2, .5*\y1+\y3)$) node {$H$}; %%I \draw let \p1=($(alphaas)-(alphabs)$), \p2=($(rlb)-(rla)$), \p3=(alphabs), \p4=(rla) in ($(.5*\x2+\x4, .5*\y1+\y3)$) node {$I$}; %%J \draw let \p1=($(alphaas)-(alphabs)$), \p2=($(cfas)-(rlb)$), \p3=(alphabs), \p4=(rlb) in ($(.5*\x2+\x4, .5*\y1+\y3)$) node {$J$}; %%K \draw let \p1=(alphabs), \p2=(rla) in ($(.5*\x2, .5*\y1)$) node {$K$}; %%M \draw let \p1=(alphabs), \p2=($(rlb)-(rla)$), \p3=(rla) in ($(.5*\x2+\x3, .5*\y1)$) node {$M$}; %%N \draw let \p1=(alphabs), \p2=($(cfas)-(rlb)$), \p3=(rlb) in ($(.5*\x2+\x3, .5*\y1)$) node {$N$}; %%O \draw let \p1=(alphabs), \p2=($(cfbs)-(cfas)$), \p3=(cfas) in ($(.5*\x2+\x3, .5*\y1)$) node {$O$}; \end{tikzpicture} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End:
\documentclass[landscape,a4paper, ngerman, 10pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage{tikz} % Use the calendar.sty style \usepackage{translator} % German Month and Day names \usepackage{fancyhdr} % header and footer \usepackage{fix-cm} % Large year in header \usepackage[landscape, headheight = 2cm, margin=.5cm, top = 3.2cm, nofoot]{geometry} \usetikzlibrary{calc} \usetikzlibrary{calendar} \renewcommand*\familydefault{\sfdefault} % User defined \def\year{2013} % Names of Holidays are inserted by employing this macro \def\termin#1#2{ \node [anchor=north west, text width= 3.4cm] at ($(cal-#1.north west)+(3em, 0em)$) {\tiny{#2}}; } %Header \renewcommand{\headrulewidth}{0.0pt} \setlength{\headheight}{10ex} \chead{ \fontsize{60}{70}\selectfont\textbf{\year} \Large\textbf{Ferienkalender}\hfill } %Footer \cfoot{\footnotesize\texttt{http://www.texample.net/}} \begin{document} \pagestyle{fancy} \begin{center} \begin{tikzpicture}[every day/.style={anchor = north}] \calendar[ dates=\year-01-01 to \year-06-30, name=cal, day yshift = 3em, day code= { \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle, minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext}; \draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize% \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}}; }, execute before day scope= { \ifdate{day of month=1} { % Shift right \pgftransformxshift{4.8cm} % Print month name \draw (0,0)node [shape=rectangle, minimum height= .53cm, text width = 4.4cm, fill = red, text= white, draw = red, text centered] {\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}}; }{} \ifdate{workday} { % normal days are white \tikzset{every day/.style={fill=white}} % Vacation (Germany, Baden-Wuerrtemberg) gray background \ifdate{between=2012-12-24 and 2013-01-05}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-03-25 and 2013-04-05}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-05-21 and 2013-06-01}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-07-25 and 2013-09-07}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-10-28 and 2013-10-30}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-12-23 and 2014-01-04}{% \tikzset{every day/.style={fill=gray!30}}}{} }{} % Saturdays and half holidays (Christma's and New year's eve) \ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{} \ifdate{equals=12-24}{\tikzset{every day/.style={fill=red!10}}}{} \ifdate{equals=12-31}{\tikzset{every day/.style={fill=red!10}}}{} % Sundays and full holidays \ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=01-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=01-06}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=05-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=10-03}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=11-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=12-25}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=12-26}{\tikzset{every day/.style={fill=red!20}}}{} % Christian holidays \ifdate{equals=2013-03-29}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-04-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-05-09}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-05-20}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-05-30}{\tikzset{every day/.style={fill=red!20}}}{} }, execute at begin day scope= { % each day is shifted down according to the day of month \pgftransformyshift{-.53*\pgfcalendarcurrentday cm} } ]; % Print name of Holidays \termin{\year-01-01}{Neujahr} \termin{\year-01-06}{Heilige Drei Könige} \termin{2013-03-29}{Karfreitag} \termin{2013-03-31}{Ostersonntag} \termin{2013-04-01}{Ostermontag} \termin{\year-05-01}{Tag der Arbeit} \termin{2013-05-09}{Christi Himmelfahrt} \termin{2013-05-19}{Pfingstsonntag} \termin{2013-05-20}{Pfingstmontag} \termin{2013-05-30}{Fronleichnam} \end{tikzpicture} % Repeat the whole thing for the second page \pagebreak \begin{tikzpicture}[every day/.style={anchor = north}] \calendar[dates=\year-07-01 to \year-12-31, name=cal, day yshift = 3em, day code= { \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle, minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext}; \draw (-1.8cm, -.1ex) node[anchor = west] { \footnotesize\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday} }; }, execute before day scope= { \ifdate{day of month=1} { % Shift right \pgftransformxshift{4.8cm} % Print month name \draw (0,0)node [shape=rectangle, minimum height= .53cm, text width = 4.4cm, fill = red, text= white, draw = red, text centered] { \textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}} }; }{} \ifdate{workday} { \tikzset{every day/.style={fill=white}} % Vacation (Germany Baden-Wuerrtemberg) \ifdate{between=2012-12-24 and 2013-01-05}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-03-25 and 2013-04-05}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-05-21 and 2013-06-01}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-07-25 and 2013-09-07}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-10-28 and 2013-10-30}{% \tikzset{every day/.style={fill=gray!30}}}{} \ifdate{between=2013-12-23 and 2014-01-04}{% \tikzset{every day/.style={fill=gray!30}}}{} }{} % Saturdays and half holidays (Christma's and New year's eve) \ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{} \ifdate{equals=12-24}{\tikzset{every day/.style={fill=red!10}}}{} \ifdate{equals=12-31}{\tikzset{every day/.style={fill=red!10}}}{} % Sundays and full holidays \ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=01-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=01-06}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=05-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=10-03}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=11-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=12-25}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=12-26}{\tikzset{every day/.style={fill=red!20}}}{} % Christian holidays \ifdate{equals=2013-03-29}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-04-01}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-05-09}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-05-20}{\tikzset{every day/.style={fill=red!20}}}{} \ifdate{equals=2013-05-30}{\tikzset{every day/.style={fill=red!20}}}{} }, execute at begin day scope= { % Each day is shifted down according to the day of month \pgftransformyshift{-.53*\pgfcalendarcurrentday cm} } ]; % Holidaynames \termin{\year-10-03}{Tag der deutschen Einheit} \termin{\year-11-01}{Allerheiligen} \termin{\year-12-24}{Heilig Abend} \termin{\year-12-25}{1.\ Weihnachtsfeiertag} \termin{\year-12-26}{2.\ Weihnachtsfeiertag} \termin{\year-12-31}{Silvester} \end{tikzpicture} \end{center} \end{document}
\documentclass[tikz,border=10pt,12pt,x11names]{standalone} \usepackage{tikz} \usetikzlibrary{circuits.logic.US} % TiKZ Library for US Logic Circuits. \begin{document} \begin{tikzpicture}[circuit logic US, every circuit symbol/.style={thick}] % Logic Gates in Left Side of Multiplexor \node[buffer gate, point down,inputs={i}] (buf1) at (-1,3) {}; % Input Ea \node[and gate,inputs={nnnn}, point down] (and1) at (0,-1) {}; \node[and gate,inputs={nnnn}, point down] (and2) at (1.5,-1) {}; \node[and gate,inputs={nnnn}, point down] (and3) at (3,-1) {}; \node[and gate,inputs={nnnn}, point down] (and4) at (4.5,-1) {}; \node[or gate,inputs={nnnn}, point down] (or1) at (2.25,-3) {}; \node[not gate, point down] (not1) at (5.5,4) {}; % Input Sa \node[buffer gate, point down,inputs={i}] (buf2) at (5.5,2.5) {}; % Left Side connections \draw [red, very thick] (buf1.output) -- ++(down:26.4mm) -| (and1.input 4); \draw (and1.output) -- ++(down:5mm) -| (or1.input 4); \draw (and2.output) -- ++(down:3mm) -| (or1.input 3); \draw (and3.output) -- ++(down:3mm) -| (or1.input 2); \draw (and4.output) -- ++(down:5mm) -| (or1.input 1); \draw (not1.output) -- (buf2.input); % Logic Gates in Right Side of Multiplexor \node[not gate, point down] (not2) at (7,4) {}; % Input Sb \node[buffer gate, point down,inputs={i}] (buf3) at (7,2.5) {}; \node[buffer gate, point down,inputs={i}] (buf4) at (13.50,3) {}; % Input Eb \node[and gate,inputs={nnnn}, point down] (and5) at (8,-1) {}; \node[and gate,inputs={nnnn}, point down] (and6) at (9.5,-1) {}; \node[and gate,inputs={nnnn}, point down] (and7) at (11,-1) {}; \node[and gate,inputs={nnnn}, point down] (and8) at (12.5,-1) {}; \node[or gate,inputs={nnnn}, point down] (or2) at (10.25,-3) {}; \draw (not2.output) -- (buf3.input); % Right Side connections \draw [red, very thick] (buf4.output) -- ++(down:26.4mm) -| (and8.input 1); \draw (and5.output) -- ++(down:5mm) -| (or2.input 4); \draw (and6.output) -- ++(down:3mm) -| (or2.input 3); \draw (and7.output) -- ++(down:3mm) -| (or2.input 2); \draw (and8.output) -- ++(down:5mm) -| (or2.input 1); % Inputs and Outputs of Multiplexer \draw [black,very thick] (buf1.input) -- ++(up:5mm) node [above]{$E_a$}; % Enable Signal a \draw [black,very thick] (buf4.input) -- ++(up:5mm) node [above]{$E_b$}; % Enable Signal b \draw [black,very thick] (not1.input) -- ++(up:5mm) node [above]{$S_a$}; % Selection Signal a \draw [black,very thick] (not2.input) -- ++(up:5mm) node [above]{$S_b$}; % Selection Signal b % Inputs I_na with n={0, 1, 2, 3} \draw [black,very thick] (and1.input 1) -- ++(up:4.3) node [above]{$I_{0a}$}; \draw [black,very thick] (and2.input 1) -- ++(up:4.3) node [above]{$I_{1a}$}; \draw [black,very thick] (and3.input 1) -- ++(up:4.3) node [above]{$I_{2a}$}; \draw [black,very thick] (and4.input 1) -- ++(up:4.3) node [above]{$I_{3a}$}; % Inputs I_nb with n={0, 1, 2, 3} \draw [black,very thick] (and5.input 4) -- ++(up:4.3) node [above]{$I_{0b}$}; \draw [black,very thick] (and6.input 4) -- ++(up:4.3) node [above]{$I_{1b}$}; \draw [black,very thick] (and7.input 4) -- ++(up:4.3) node [above]{$I_{2b}$}; \draw [black,very thick] (and8.input 4) -- ++(up:4.3) node [above]{$I_{3b}$}; % Output of NOT gates \draw [blue, very thick] (not1.output) -- ++(down:2.5mm) -- ++(left:5mm) -- (5,0.45); \draw [blue, very thick] (not1.output) -- (buf2.input); \draw [Gold3, very thick] (not2.output) -- ++(down:2.5mm) -- ++(left:5mm) -- (6.5,0.1); \draw [Gold3, very thick] (not2.output) -- (buf3.input); % Output of BUFFER gates \draw [Brown4, very thick] (buf2.output) -- (5.5,1); \draw [Green4, very thick] (buf3.output) -- (7,0.7); % Interconnection of AND gates \draw [red,very thick] (and1.input 4) -- ++(up:3mm) -| (and2.input 4) -- ++(up:3mm) -| (and3.input 4) -- ++(up:3mm) -| (and4.input 4); \draw [red,very thick] (and5.input 1) -- ++(up:3mm) -| (and6.input 1) -- ++(up:3mm) -| (and7.input 1) -- ++(up:3mm) -| (and8.input 1); \draw [blue,very thick] (and1.input 3) -- ++(up:9mm) -| (and2.input 3) -- ++(up:9mm) -| (and5.input 3) -- ++(up:9mm) -| (and6.input 3); \draw [Gold3,very thick] (and1.input 2) -- ++(up:6mm) -| (and3.input 2) -- ++(up:6mm) -| (and5.input 2) -- ++(up:6mm) -| (and7.input 2); \draw [Green4,very thick] (and2.input 2) -- ++(up:12mm) -| (and4.input 2) -- ++(up:12mm) -| (and6.input 2) -- ++(up:12mm) -| (and8.input 2); \draw [Brown4,very thick] (and3.input 3) -- ++(up:15mm) -| (and4.input 3) -- ++(up:15mm) -| (and7.input 3) -- ++(up:15mm) -| (and8.input 3); % Outputs of multiplexer % Buffers at output of OR logic gates. \node[buffer gate, point down,inputs={i}] (1y) at (2.25,-4.5) {}; \node[buffer gate, point down,inputs={i}] (2y) at (10.25,-4.5) {}; % Connecting output of OR logic gates to Buffers input \draw (or1.output) -- (1y.input); \draw (or2.output) -- (2y.input); % Outputs of multiplexer \draw (1y.output) -- ++(down:5mm) node [below]{$1Y$}; \draw (2y.output) -- ++(down:5mm) node [below]{$2Y$}; \end{tikzpicture} \end{document}
\documentclass{minimal} \usepackage[a4paper,margin=1cm,landscape]{geometry} \usepackage{tikz} \usetikzlibrary{positioning,shapes,shadows,arrows} \begin{document} \tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=blue!40, drop shadow, text centered, anchor=north, text=white, text width=3cm] \tikzstyle{comment}=[rectangle, draw=black, rounded corners, fill=green, drop shadow, text centered, anchor=north, text=white, text width=3cm] \tikzstyle{myarrow}=[->, >=open triangle 90, thick] \tikzstyle{line}=[-, thick] \begin{center} \begin{tikzpicture}[node distance=2cm] \node (Item) [abstract, rectangle split, rectangle split parts=2] { \textbf{ITEM} \nodepart{second}name }; \node (AuxNode01) [text width=4cm, below=of Item] {}; \node (Component) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode01] { \textbf{COMPONENT} \nodepart{second}nil }; \node (System) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode01] { \textbf{SYSTEM} \nodepart{second}parts }; \node (AuxNode02) [text width=0.5cm, below=of Component] {}; \node (Sensor) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode02] { \textbf{SENSOR} \nodepart{second}nil }; \node (Part) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode02] { \textbf{PART} \nodepart{second}nil }; \node (AuxNode03) [below=of Sensor] {}; \node (Pressure) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode03, xshift=2cm] { \textbf{Pressure} \nodepart{second}nil }; \node (Temperature) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode03, xshift=-2cm] { \textbf{Temperature} \nodepart{second}nil }; \node (PressureInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Pressure, text justified] { \textbf{Instants} \nodepart{second}fw-p-suction\newline fw-p-delivery\newline fw-p-loop\newline sw-p-suction\newline sw-p-delivery \newline sw-p-loop }; \node (ClOp) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of PressureInstants] { \textbf{Closed/Open} \nodepart{second}nil }; \node (ClOpInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of ClOp, text justified] { \textbf{Instants} \nodepart{second}fw-clop-warm-up\newline sw-clop-control }; \node (TemperatureInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Temperature, text justified] { \textbf{Instants} \nodepart{second}fw-t-engine\newline fw-t-heat-exch.\newline sw-t-heat-exch. }; \node (Level) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of TemperatureInstants] { \textbf{Level} \nodepart{second}nil }; \node (LevelInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Level, text justified] { \textbf{Instants} \nodepart{second}fw-l-tank }; \node (Ammeter) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of LevelInstants] { \textbf{Ammeter} \nodepart{second}nil }; \node (AmmeterInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Ammeter, text justified] { \textbf{Instants} \nodepart{second}fw-pump-ammeter\newline sw-pump-ammeter }; \node (AuxNode04) [below=of Part] {}; \node (Pump) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode04, xshift=2cm] { \textbf{Pump} \nodepart{second}nil }; \node (Valve) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode04, xshift=-2cm] { \textbf{Valve} \nodepart{second}nil }; \node (PumpInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Pump, text justified] { \textbf{Instants} \nodepart{second}fw-pump\newline sw-pump }; \node (Tank) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of PumpInstants] { \textbf{Tank} \nodepart{second}nil }; \node (ValveInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Valve, text justified] { \textbf{Instants} \nodepart{second}fw-suction-valve\newline fw-delivery-valve\newline sw-suction-valve\newline sw-delivery-valve \newline sw-discharge-valve\newline sw-control-valve }; \node (Engine) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of ValveInstants] { \textbf{Engine} \nodepart{second}nil }; \node (TankInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Tank, text justified] { \textbf{Instants} \nodepart{second}fw-expansion-tank }; \node (HeatExchanger) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of TankInstants] { \textbf{Heat Exchanger} \nodepart{second}nil }; \node (HeatExchangerInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of HeatExchanger, text justified] { \textbf{Instants} \nodepart{second}fw-heat-exchanger }; \node (EngineInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Engine, text justified] { \textbf{Instants} \nodepart{second}fw-engine }; \node (Strainer) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of HeatExchangerInstants] { \textbf{Strainer} \nodepart{second}nil }; \node (StrainerInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Strainer, text justified] { \textbf{Instants} \nodepart{second}sw-strainer }; \node (Coolant) [abstract, rectangle split, rectangle split parts=2, below=0.4cm of EngineInstants] { \textbf{Coolant} \nodepart{second}nil }; \node (CoolantInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of Coolant, text justified] { \textbf{Instants} \nodepart{second}fw-coolant\newline sw-coolant }; \node (AuxNode05) [below=of System] {}; \node (CoolingSystem) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode05, xshift=2cm] { \textbf{Cooling System} \nodepart{second}nil }; \node (CoolingLoop) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode05, xshift=-2cm] { \textbf{Cooling Loop} \nodepart{second}nil }; \node (CoolingSystemInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of CoolingSystem, text justified] { \textbf{Instants} \nodepart{second}cool }; \node (CoolingLoopInstants) [comment, rectangle split, rectangle split parts=2, below=0.2cm of CoolingLoop, text justified] { \textbf{Instants} \nodepart{second}fw-loop\newline sw-loop }; \draw[myarrow] (Component.north) -- ++(0,0.8) -| (Item.south); \draw[line] (Component.north) -- ++(0,0.8) -| (System.north); \draw[myarrow] (Sensor.north) -- ++(0,0.8) -| (Component.south); \draw[line] (Sensor.north) -- ++(0,0.8) -| (Part.north); \draw[line] (Pressure.west) -- ++(-0.2,0); \draw[line] (Temperature.east) -- ++(0.2,0); \draw[line] (Level.east) -- ++(0.2,0); \draw[myarrow] (ClOp.west) -- ++(-0.2,0) -- ([yshift=0.5cm, xshift=-0.2cm] Pressure.north west) -| ([xshift=-1cm]Sensor.south); \draw[myarrow] (Ammeter.east) -- ++(0.2,0) -- ([yshift=0.5cm, xshift=0.2cm] Temperature.north east) -| ([xshift=1cm]Sensor.south); \draw[line] (Tank.west) -- ++(-0.2,0); \draw[line] (HeatExchanger.west) -- ++(-0.2,0); \draw[line] (Pump.west) -- ++(-0.2,0); \draw[line] (Valve.east) -- ++(0.2,0); \draw[line] (Engine.east) -- ++(0.2,0); \draw[myarrow] (Strainer.west) -- ++(-0.2,0) -- ([yshift=0.5cm, xshift=-0.2cm] Pump.north west) -| ([xshift=-1cm]Part.south); \draw[myarrow] (Coolant.east) -- ++(0.2,0) -- ([yshift=0.5cm, xshift=0.2cm] Valve.north east) -| ([xshift=1cm]Part.south); \draw[myarrow] (CoolingSystem.north) -- ++(0,0.8) -| (System.south); \draw[line] (CoolingSystem.north) -- ++(0,0.8) -| (CoolingLoop.north); \end{tikzpicture} \end{center} \end{document}
\documentclass{article} \usepackage[gray]{xcolor} \usepackage{tikz,pgffor} \usetikzlibrary{shadows} \begin{document} %\begin{figure} \centering \begin{tikzpicture} %\draw[help lines] (0,0) grid (10,10); %used just for visualising the positions of objects during construction \begin{scope}[yshift=-180,yslant=0.5,xslant=-1] %the rectangular surface onto which the clusters are located \filldraw[black!10,very thick] (0.5,1) rectangle (10,7); %circle circumventing the smallest cluster \node[circle,circular glow,fill=red!20,draw=red,thick] at (4.1,4.9) {\phantom{perimetro}}; \end{scope} %atom clusters are rotated for a better visualisation \begin{scope}[rotate around = {-5:(0,0,0)}] %text describing the objects in the picture \draw[-latex,thick] (6,3) node[right,text width=3cm] {$\mathsf{potent\; perimeter\; sites}$} to [out=180,in=0] (4.5,1); \draw[-latex,thick](3,-1)node[right] {$\mathsf{Non-metallic\; molecule}$} to[out=180,in=0] (2.6,-3); \draw[-latex,thick](-3,-1)node[above] {$\mathsf{extra \; electron}$} to[out=-90,in=180] (-1.4,-2); %now we start with the clusters (maybe this code could be improved by a tikz expert) %the layers are built starting from the very lowest one %largest cluster %first row \foreach \x in {1.5,2,2.5,3,3.5,4}% \shadedraw [ball color= red] (\x,1,-0.5) circle (0.25cm); \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25}% \shadedraw [ball color= red] (\x,1,0) circle (0.25cm); \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5}% \shadedraw [ball color= red] (\x,1,0.5) circle (0.25cm); \foreach \x in {0.75,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75}% \shadedraw [ball color= red] (\x,1,1) circle (0.25cm); \foreach \x in {0.5,1,1.5,2,2.5,3,3.5,4,4.5,5}% \shadedraw [ball color= red] (\x,1,1.5) circle (0.25cm); \foreach \x in {0.5,1,1.5,2,2.5,3,3.5,4,4.5,5} \shadedraw [ball color=red] (\x,1,2) circle (0.25cm); \foreach \x in {0.75,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75}% \shadedraw [ball color= red] (\x,1,2.5) circle (0.25cm); \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5}% \shadedraw [ball color= red] (\x,1,3) circle (0.25cm); \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25}% \shadedraw [ball color= red] (\x,1,3.5) circle (0.25cm); \foreach \x in {1.5,2,2.5,3,3.5,4}% \shadedraw [ball color= red] (\x,1,4) circle (0.25cm); %second row \foreach \x in {1.75,2.25,2.75,3.25,3.75} \shadedraw [ball color=yellow] (\x,1.5,0) circle (0.25cm); \foreach \x in {1.5,2,2.5,3,3.5,4} \shadedraw [ball color=yellow] (\x,1.5,0.5) circle (0.25cm); \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25} \shadedraw [ball color=yellow] (\x,1.5,1) circle (0.25cm); \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5} \shadedraw [ball color=yellow] (\x,1.5,1.5) circle (0.25cm); \foreach \x in {0.75,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75} \shadedraw [ball color=yellow] (\x,1.5,2) circle (0.25cm); \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5} \shadedraw [ball color=yellow] (\x,1.5,2.5) circle (0.25cm); \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25} \shadedraw [ball color=yellow] (\x,1.5,3) circle (0.25cm); \foreach \x in {1.5,2,2.5,3,3.5,4} \shadedraw [ball color=yellow] (\x,1.5,3.5) circle (0.25cm); \foreach \x in {1.75,2.25,2.75,3.25,3.75} \shadedraw [ball color=yellow] (\x,1.5,4) circle (0.25cm); %third row \foreach \x in {2,2.5,3,3.5} \shadedraw [ball color=yellow] (\x,2,1) circle (0.25cm); \foreach \x in {1.75,2.25,2.75,3.25,3.75} \shadedraw [ball color=yellow] (\x,2,1.5) circle (0.25cm); \foreach \x in {1.5,2,2.5,3,3.5,4} \shadedraw [ball color=yellow] (\x,2,2) circle (0.25cm); \foreach \x in {1.25,1.75,2.25,2.75,3.5,3.75,4.25} \shadedraw [ball color=yellow] (\x,2,2.5) circle (0.25cm); \foreach \x in {1.5,2,2.5,3,3.5,4} \shadedraw [ball color=yellow] (\x,2,3) circle (0.25cm); \foreach \x in {1.75,2.25,2.75,3.25,3.75} \shadedraw [ball color=yellow] (\x,2,3.5) circle (0.25cm); \foreach \x in {2,2.5,3,3.5} \shadedraw [ball color=yellow] (\x,2,4) circle (0.25cm); %fourth row \foreach \x in {2.25,2.75,3.25} \shadedraw [ball color=yellow] (\x,2.5,2) circle (0.25cm); \foreach \x in {2,2.5,3,3.5} \shadedraw [ball color=yellow] (\x,2.5,2.5) circle (0.25cm); \foreach \x in {1.75,2.25,2.75,3.25,3.75} \shadedraw [ball color=yellow] (\x,2.5,3) circle (0.25cm); \foreach \x in {2,2.5,3,3.5} \shadedraw [ball color=yellow] (\x,2.5,3.5) circle (0.25cm); \foreach \x in {2.25,2.75,3.25} \shadedraw [ball color=yellow] (\x,2.5,4) circle (0.25cm); %medium cluster %first row \foreach \x in {6.75,7.25} \shadedraw [ball color=yellow] (\x,2.5,13) circle (0.25cm); \foreach \x in {6.5,7,7.5} \shadedraw [ball color=yellow] (\x,2.5,13.5) circle (0.25cm); \foreach \x in {6.25,6.75,7.25,7.75} \shadedraw [ball color=yellow] (\x,2.5,14) circle (0.25cm); \foreach \x in {6.5,7,7.5} \shadedraw [ball color=yellow] (\x,2.5,14.5) circle (0.25cm); \foreach \x in {6.75,7.25} \shadedraw [ball color=yellow] (\x,2.5,15) circle (0.25); %second row \foreach \x in {7} %this foreach is used to be general, but it makes no sense if we put just one sphere! \shadedraw [ball color=yellow] (\x,3,13.25) circle (0.25cm); \foreach \x in {6.75,7.25} \shadedraw [ball color=yellow] (\x,3,13.75) circle (0.25cm); \foreach \x in {6.5,7,7.5} \shadedraw [ball color=yellow] (\x,3,14.25) circle (0.25cm); \foreach \x in {6.75,7.25} \shadedraw [ball color=yellow] (\x,3,14.75) circle (0.25cm); \foreach \x in {7} \shadedraw [ball color=yellow] (\x,3,15.25) circle (0.25); %smallest cluster of atoms \foreach \x in {2.75,3.25,3.75} \shadedraw [ball color = gray] (\x,2,10) circle (0.25); \foreach \x in {3,3.5} \shadedraw [ball color=gray] (\x,2,10.5) circle (0.25); \shadedraw [ball color = gray] (3.25,2,11) circle (0.25); \foreach \x in {3,3.5} \shadedraw [ball color = gray] (3,2.5,10.25) circle (0.25); \shadedraw [ball color = gray] (3.5,2.5,11) circle (0.25); \shadedraw [ball color=gray] (2,1,12.5) circle(0.25); \draw[-latex,thick](-4,-3)node[above] {$\mathsf{single \; metal\; atom}$} to[out=-90,in=180] (-3,-4); \end{scope} \end{tikzpicture} %\end{figure} \end{document}
\documentclass[11pt]{article} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage{tikz} \usetikzlibrary{% shapes, decorations.shapes, decorations.fractals, decorations.markings, shadows } \newsavebox{\mycandle} \savebox{\mycandle}{ \begin{tikzpicture}[scale=.1] \shade[top color=yellow,bottom color=red] (0,0) .. controls (1,.2) and (1,.5) .. (0,2) .. controls (-1,.5) and (-1,.2) .. (0,0); \fill[yellow!90!black] (.8,0) rectangle (-.8,-5); \end{tikzpicture} } \tikzset{ paint/.style={draw=#1!50!black, fill=#1!50}, my star/.style={decorate,decoration={shape backgrounds,shape=star}, star points=#1} } \begin{document} \begin{tikzpicture}[ ball red/.style={ decorate, decoration={ markings, mark=between positions .2 and 1 step 3cm with { \pgfmathsetmacro{\sz}{2 + .5 * rand} \path[shading=ball,ball color=red] (0,0) circle[radius=\sz mm]; } } } ,ball blue/.style={ decorate, decoration={ markings, mark=between positions 0.1 and .9 step 3cm with { \pgfmathsetmacro{\sz}{2 + .5 * rand} \path[shading=ball,ball color=blue] (0,0) circle[radius=\sz mm]; } } } ] \draw[fill=Maroon,ultra thick] (.75,-1) .. controls (.5,.5) and (.5,3) .. (0.5,4) -- (-0.5,4) .. controls (-.5,3) and (-.5,.5) .. (-.75,-1) ; \draw[ultra thick,fill=green!50!black] (0,10) .. controls (0,8) and (1,7) .. (1.5,7) .. controls (1,7) and (1,7) .. (0.5,7.25) .. controls (1.5,5) and (2.5,4) .. (3,4) .. controls (2,4) and (1.25,4) .. (1,4.5) .. controls (2,2) and (3.5,2) .. (4,2) .. controls (1,1) and (-1,1) .. (-4,2) .. controls (-3.5,2) and (-2,2) .. (-1,4.5) .. controls (-1.25,4) and (-2,4) .. (-3,4) .. controls (-2.5,4) and (-1.5,5) .. (-0.5,7.25) .. controls (-1,7) and (-1,7) .. (-1.5,7) .. controls (-1,7) and (0,8) .. (0,10) ; \foreach \candle in {(2,5),(-2,5),(0.5,7.5),(-0.5,7.5),(-3,2.5), (3,2.5), (1.5,1.75),(-1.5,1.75)} \node at \candle {\usebox{\mycandle}} ; \node [star, star point height=.5cm, minimum size=.5cm,draw,fill=yellow,thick] at (0,10) {}; \begin{scope}[decoration={shape sep=.2cm, shape size=.25cm}] \draw [my star=6, paint=red] (-4,2) .. controls (0,2) and (1,3.5) .. (1,4.40); \draw [my star=6, paint=red] (-1.5,5.40) .. controls (0,5.40) and (0.5,6.5) .. (0.5,7); \draw [my star=6, paint=blue] (4,2) .. controls (0,2) and (-1,3.5) .. (-1,4.40); \draw [my star=6, paint=blue] (1.5,5.40) .. controls (0,5.40) and (-0.5,6.5) .. (-0.5,7); \end{scope} % the balls \path[ball red] (0,10) .. controls (0,8) and (1,7) .. (1.5,7) .. controls (1,7) and (1,7) .. (0.5,7.25) .. controls (1.5,5) and (2.5,4) .. (3,4) .. controls (2,4) and (1.25,4) .. (1,4.5) .. controls (2,2) and (3.5,2) .. (4,2) .. controls (1,1) and (-1,1) .. (-4,2) .. controls (-3.5,2) and (-2,2) .. (-1,4.5) .. controls (-1.25,4) and (-2,4) .. (-3,4) .. controls (-2.5,4) and (-1.5,5) .. (-0.5,7.25) .. controls (-1,7) and (-1,7) .. (-1.5,7) .. controls (-1,7) and (0,8) .. (0,10) ; \path[ball blue] (0,10) .. controls (0,8) and (1,7) .. (1.5,7) .. controls (1,7) and (1,7) .. (0.5,7.25) .. controls (1.5,5) and (2.5,4) .. (3,4) .. controls (2,4) and (1.25,4) .. (1,4.5) .. controls (2,2) and (3.5,2) .. (4,2) .. controls (1,1) and (-1,1) .. (-4,2) .. controls (-3.5,2) and (-2,2) .. (-1,4.5) .. controls (-1.25,4) and (-2,4) .. (-3,4) .. controls (-2.5,4) and (-1.5,5) .. (-0.5,7.25) .. controls (-1,7) and (-1,7) .. (-1.5,7) .. controls (-1,7) and (0,8) .. (0,10) ; % the snow \foreach \i in {0.5,0.6,...,1.6} \fill [white!80!blue,decoration=Koch snowflake,opacity=.9] [shift={(rand*5,rnd*8)},scale=\i] [double copy shadow={opacity=0.2,shadow xshift=0pt, shadow yshift=3*\i pt,fill=white,draw=none}] decorate { decorate { decorate { (0,0) -- ++(60:1) -- ++(-60:1) -- cycle } } }; \end{tikzpicture} \end{document}
\documentclass[a4paper,landscape]{article} \usepackage{pgf,tikz} \usetikzlibrary{calc,arrows} \usepackage{amsmath} \usepackage[left=1cm,right=1cm]{geometry} \pagestyle{empty} \makeatletter % Data Flip Flip (DFF) shape \pgfdeclareshape{dff}{ % The 'minimum width' and 'minimum height' keys, not the content, determine % the size \savedanchor\northeast{% \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% \pgfmathsetlength\pgf@y{\pgfshapeminheight}% \pgf@x=0.5\pgf@x \pgf@y=0.5\pgf@y } % This is redundant, but makes some things easier: \savedanchor\southwest{% \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% \pgfmathsetlength\pgf@y{\pgfshapeminheight}% \pgf@x=-0.5\pgf@x \pgf@y=-0.5\pgf@y } % Inherit from rectangle \inheritanchorborder[from=rectangle] % Define same anchor a normal rectangle has \anchor{center}{\pgfpointorigin} \anchor{north}{\northeast \pgf@x=0pt} \anchor{east}{\northeast \pgf@y=0pt} \anchor{south}{\southwest \pgf@x=0pt} \anchor{west}{\southwest \pgf@y=0pt} \anchor{north east}{\northeast} \anchor{north west}{\northeast \pgf@x=-\pgf@x} \anchor{south west}{\southwest} \anchor{south east}{\southwest \pgf@x=-\pgf@x} \anchor{text}{ \pgfpointorigin \advance\pgf@x by -.5\wd\pgfnodeparttextbox% \advance\pgf@y by -.5\ht\pgfnodeparttextbox% \advance\pgf@y by +.5\dp\pgfnodeparttextbox% } % Define anchors for signal ports \anchor{D}{ \pgf@process{\northeast}% \pgf@x=-1\pgf@x% \pgf@y=.5\pgf@y% } \anchor{CLK}{ \pgf@process{\northeast}% \pgf@x=-1\pgf@x% \pgf@y=-.66666\pgf@y% } \anchor{CE}{ \pgf@process{\northeast}% \pgf@x=-1\pgf@x% \pgf@y=-0.33333\pgf@y% } \anchor{Q}{ \pgf@process{\northeast}% \pgf@y=.5\pgf@y% } \anchor{Qn}{ \pgf@process{\northeast}% \pgf@y=-.5\pgf@y% } \anchor{R}{ \pgf@process{\northeast}% \pgf@x=0pt% } \anchor{S}{ \pgf@process{\northeast}% \pgf@x=0pt% \pgf@y=-\pgf@y% } % Draw the rectangle box and the port labels \backgroundpath{ % Rectangle box \pgfpathrectanglecorners{\southwest}{\northeast} % Angle (>) for clock input \pgf@anchor@dff@CLK \pgf@xa=\pgf@x \pgf@ya=\pgf@y \pgf@xb=\pgf@x \pgf@yb=\pgf@y \pgf@xc=\pgf@x \pgf@yc=\pgf@y \pgfmathsetlength\pgf@x{1.6ex} % size depends on font size \advance\pgf@ya by \pgf@x \advance\pgf@xb by \pgf@x \advance\pgf@yc by -\pgf@x \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}} \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}} \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}} \pgfclosepath % Draw port labels \begingroup \tikzset{flip flop/port labels} % Use font from this style \tikz@textfont \pgf@anchor@dff@D \pgftext[left,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=\pgfshapeinnerxsep]{\raisebox{-0.75ex}{D}} \pgf@anchor@dff@CE \pgftext[left,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=\pgfshapeinnerxsep]{\raisebox{-0.75ex}{CE}} \pgf@anchor@dff@Q \pgftext[right,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=-\pgfshapeinnerxsep]{\raisebox{-.75ex}{Q}} \pgf@anchor@dff@Qn \pgftext[right,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=-\pgfshapeinnerxsep]{\raisebox{-.75ex}{$\overline{\mbox{Q}}$}} \pgf@anchor@dff@R \pgftext[top,at={\pgfpoint{\pgf@x}{\pgf@y}},y=-\pgfshapeinnerysep]{R} \pgf@anchor@dff@S \pgftext[bottom,at={\pgfpoint{\pgf@x}{\pgf@y}},y=\pgfshapeinnerysep]{S} \endgroup } } % Key to add font macros to the current font \tikzset{add font/.code={\expandafter\def\expandafter\tikz@textfont\expandafter{\tikz@textfont#1}}} % Define default style for this node \tikzset{flip flop/port labels/.style={font=\sffamily\scriptsize}} \tikzset{every dff node/.style={draw,minimum width=2cm,minimum height=2.828427125cm,very thick,inner sep=1mm,outer sep=0pt,cap=round,add font=\sffamily}} \makeatother \begin{document} \begin{tikzpicture}[font=\sffamily,>=triangle 45] \def\N{7} % Number of Flip-Flops minus one % Place FFs \foreach \m in {0,...,\N} \node [shape=dff] (DFF\m) at ($ 3*(\m,0) $) {Bit \#\m}; % Connect FFs (Q1 with D1, etc.) \def\p{0} % Used to save the previous number \foreach \m in {1,...,\N} { % Note that it starts with 1, not 0 \draw [->] (DFF\p.Q) -- (DFF\m.D); \global\let\p\m } % Connect and label data in- and output port \draw [<-] (DFF0.D) -- +(-1,0) node [anchor=east] {input} ; \draw [->] (DFF\N.Q) -- +(1,0) node [anchor=west] {output}; % 'Reset' port label \path (DFF0) +(-2cm,+2cm) coordinate (temp) node [anchor=east] {reset}; % Connect resets \foreach \m in {0,...,\N} \draw [->] (temp) -| (DFF\m.R); % 'Set' port label \path (DFF0) +(-2cm,-2cm) coordinate (temp) node [anchor=east] {set}; % Connect sets \foreach \m in {0,...,\N} \draw [->] (temp) -| (DFF\m.S); % Clock port label \path (DFF0) +(-2cm,-2.5cm) coordinate (temp) node [anchor=east] {clock}; \foreach \m in {0,...,\N} \draw [->] (temp) -| ($ (DFF\m.CLK) + (-5mm,0) $) --(DFF\m.CLK); % Clock port label \path (DFF0) +(-2cm,-3cm) coordinate (temp) node [anchor=east] {clock enable}; \foreach \m in {0,...,\N} \draw [->] (temp) -| ($ (DFF\m.CE) + (-7.5mm,0) $) --(DFF\m.CE); \end{tikzpicture} \end{document}
\documentclass{beamer} \usepackage{tikz} \usepackage{animate} % Define a the counter cnt. Used to identify files generated for use % with Gnuplot. \newcounter{cnt} \setcounter{cnt}{0} % Macro for drawing one frame of the F-distribution animation. \newcommand{\fdst}[4]{% % shade the critical region tail \draw[fill,orange] (#1,0) -- plot[id=5\thecnt,domain=#1:5.5,samples=50] function {#4*(x**(0.5*#2-1))*((1+#2*x/#3)**(-0.5*#2-0.5*#3))} -- (5.5,0) -- cycle; % draw the F distribution curve \draw[color=blue!50!black,thick] plot[id=f4\thecnt,smooth,domain=0:5.5,samples=100] function {#4*(x**(0.5*#2-1))*((1+#2*x/#3)**(-0.5*#2-0.5*#3))}; % draw the F axis \draw[->] (0,0) -- (6,0) node[right] {$F$}; % label the critical region boundary \draw (#1,0) -- (#1,-0.02) node[below] {$#1$}; % label 0 \draw (0,0) -- (0,-0.02) node[below] {$0$}; % add some lables for degrees of freedom and alpha level \draw (2,0.5) node[right] {$df_1 = #2$}; \draw (2,0.4) node[right] {$df_2 = #3$}; \draw (2,0.3) node[right] {$\alpha = 0.10$}; % draw the y axis \draw[very thin,->] (0,0) -- (0,0.8); } \newcommand{\distpic}[3]{ % First draw the upper distribution. % Shade the critical region: \fill[red!30] (0.658,0) -- plot[id=f3,domain=0.658:3,samples=50] function {exp(-x*x*0.5/0.16)} -- (3,0) -- cycle; % Draw the normal distribution curve \draw[blue!50!black,smooth,thick] plot[id=f1,domain=-2:3,samples=50] function {exp(-x*x*0.5/0.16)}; % Draw the x-axis \draw[->,black] (-2.2,0) -- (3.2,0); % Put some ticks and tick labels in: \foreach \x in {-2,-1,0,1,2,3} \draw (\x,0) -- (\x,-0.1) node[below] {$\x$}; % Put in a label for the critical region boundary: \draw[red!50!black,thick] (0.658,0) node[below,yshift=-0.5cm] {0.658} -- (0.658,0.85); % Put in labels for accepting or rejecting the null hypothesis with % the corresponding regions: \draw[red!50!black,thick,->] (0.688,0.7) -- (1.3,0.7) node[anchor=south] {Reject $H_0$}; \draw[red!50!black,thick,->] (0.628,0.7) -- (-1,0.7) node[anchor=south]{\parbox{1.5cm}{\raggedright Fail to reject $H_0$}}; % Add a label to the upper picture, when the null is true \draw (-3,1) node[above,draw,fill=green!30] {$H_0$ is true:}; % Label the critical region with an alpha level: \draw[<-,thick] (0.75,0.05) -- (1.6,0.2) node[right,yshift=0.3cm] {\begin{tabular}{l} $\alpha=0.05$ \\ (Type I error rate) \end{tabular}}; % Add a label showing the effect size between the two plots: \draw[very thin] (0,-1) -- (0,-0.5); \draw[<->,thick] (0,-1) node[left] {Effect size: #1} -- (#1,-1); \draw[thick] (0,-.9) -- (0,-1.1); \draw[very thin] (#1,-1) -- (#1,-1.7); \draw[thick] (#1,-.9) -- (#1,-1.1); % Now draw the lower distribution showing the effect size: \begin{scope}[yshift=-3cm] % Shade the "reject H0" region red \fill[red!30] (0.658,0) -- plot[id=f3\thecnt,domain=0.658:3,samples=50] function {exp(-(x-#1)*(x-#1)*0.5/0.16)} -- (3,0) -- cycle; % Shade the "accept H0" region blue \fill[blue!30] (-2,0) -- plot[id=f4\thecnt,domain=-2:0.658,samples=50] function {exp(-(x-#1)*(x-#1)*0.5/0.16)} -- (0.658,0) -- cycle; % Draw the shifted normal distribution: \draw[blue!50!black,smooth,thick] plot[id=f1\thecnt,domain=-2:3,samples=50] function {exp(-(x-#1)*(x-#1)*0.5/0.16)}; % Draw the x-axis and put in some ticks and tick labels \draw[->,black] (-2.2,0) -- (3.2,0); \foreach \x in {-2,-1,0,1,2,3} \draw (\x,0) -- (\x,-0.1) node[below] {$\x$}; % Draw and label the critical region boundary \draw[red!50!black,very thick] (0.658,0) node[below,yshift=-0.5cm] {0.658} -- (0.658,1.0); \draw[red!50!black,very thick,->] (0.688,0.7) -- (2.7,0.7) node[anchor=south west] {Reject $H_0$}; \draw[red!50!black,very thick,->] (0.628,0.7) -- (-0.5,0.7) node[anchor=south]{\parbox{1.5cm}{\raggedright Fail to reject $H_0$}}; % Add a label to the lower picture, when the alternative hypothesis is true: \draw (-3,1) node[above,draw,fill=green!30] {$H_a$ is true:}; % Add labels showing the statistical power and the Type II error rate: \draw[<-,thick] (1.5,0.1) -- (3,0.2) node[anchor=south west] {Power = \large #2}; \draw[<-,thick] (0.4,0.1) -- (-1,0.2) node[left,yshift=0.3cm] {\begin{tabular}{l} $\beta$ = {\large #3} \\ (Type II error rate) \end{tabular}}; \end{scope} } \begin{document} \begin{frame} General form for the $F$ distribution with $\nu_1$ and $\nu_2$ degrees of freedom: \[ f(F; \nu_1, \nu_2) = \frac{\Gamma\left(\frac{\nu_1+\nu_2}{2}\right)} {\Gamma\left(\frac{\nu_1}{2}\right)\Gamma\left(\frac{\nu_2}{2}\right)} \left(\frac{\nu_1}{\nu_2}\right)^{\frac{\nu_1}{2}} \frac{F^{\frac{\nu_1-2}{2}}}{\left[1 + \left(\frac{\nu_1}{\nu_2}\right)F\right]^{\frac{\nu_1+\nu_2}{2}}} \] Critical region for an $F$ test for various degrees of freedom: \begin{center} \begin{animateinline}[autoplay,palindrome, begin={\begin{tikzpicture}[yscale=4]}, end={\stepcounter{cnt}\end{tikzpicture}}]{8} \fdst{5.3426}{4}{3}{6.6667};\newframe \fdst{4.1072}{4}{4}{6};\newframe \fdst{3.5202}{4}{5}{5.6};\newframe \fdst{3.1808}{4}{6}{5.3333};\newframe \fdst{2.9605}{4}{7}{5.1429};\newframe \fdst{2.8064}{4}{8}{5};\newframe \fdst{2.6927}{4}{9}{4.8889};\newframe \fdst{2.6053}{4}{10}{4.8};\newframe \fdst{2.5216}{5}{10}{10.3684};\newframe \fdst{2.6106}{5}{9}{10.7120};\newframe \fdst{2.7264}{5}{8}{11.1463};\newframe \fdst{2.8833}{5}{7}{11.7125};\newframe \fdst{3.1075}{5}{6}{12.4807};\newframe \fdst{3.4530}{5}{5}{13.5812};\newframe \fdst{4.0506}{5}{4}{15.2856};\newframe \fdst{5.3092}{5}{3}{18.2638};\newframe \fdst{5.2847}{6}{3}{52.5};\newframe \fdst{4.0097}{6}{4}{40.5};\newframe \fdst{3.4045}{6}{5}{34.02};\newframe \fdst{3.0546}{6}{6}{30};\newframe \fdst{2.8274}{6}{7}{27.2755};\newframe \fdst{2.6683}{6}{8}{25.3125};\newframe \fdst{2.5509}{6}{9}{23.8333};\newframe \fdst{2.4606}{6}{10}{22.6800};\newframe \fdst{2.4140}{7}{10}{50.4952};\newframe \fdst{2.5053}{7}{9}{54.1009};\newframe \fdst{2.6241}{7}{8}{58.8076};\newframe \fdst{2.7849}{7}{7}{65.1899};\newframe \fdst{3.0145}{7}{6}{74.2894};\newframe \fdst{3.3679}{7}{5}{88.1895};\newframe \fdst{3.9790}{7}{4}{111.6641};\newframe \fdst{5.2662}{7}{3}{158.1280};\newframe \fdst{5.2517}{8}{3}{497.7779};\newframe \fdst{3.9549}{8}{4}{320};\newframe \fdst{3.3393}{8}{5}{236.544};\newframe \fdst{2.9830}{8}{6}{189.6296};\newframe \fdst{2.7516}{8}{7}{160.0933};\newframe \fdst{2.5893}{8}{8}{140};\newframe \fdst{2.4694}{8}{9}{125.5418};\newframe \fdst{2.3772}{8}{10}{114.688};\newframe \fdst{2.3473}{9}{10}{266.0};\newframe \fdst{2.4403}{9}{9}{298.0};\newframe \fdst{2.5612}{9}{8}{341.7};\newframe \fdst{2.7247}{9}{7}{404.0};\newframe \fdst{2.9577}{9}{6}{498.7};\newframe \fdst{3.3163}{9}{5}{655.8};\newframe \fdst{3.9357}{9}{4}{941.5};\newframe \fdst{5.2400}{9}{3}{1633.2}; \end{animateinline} \end{center} \end{frame} \begin{frame} Statistical power in hypothesis testing: \begin{animateinline}[autoplay,loop, begin={\begin{tikzpicture}[scale=1.3]}, end={\stepcounter{cnt}\end{tikzpicture}}]{3} \distpic{0.5}{.346}{.654} \newframe \distpic{0.7}{.542}{.458}\newframe \distpic{0.9}{.727}{.273}\newframe \distpic{1.1}{.865}{.135}\newframe \distpic{1.3}{.946}{.054}\newframe \distpic{1.5}{.982}{.018}\newframe \distpic{1.7}{.995}{.005}\newframe \distpic{1.9}{.999}{.001} \end{animateinline} \end{frame} \end{document}
\documentclass[x11names]{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows,chains} \begin{document} % ================================================= % Set up a few colours \colorlet{lcfree}{Green3} \colorlet{lcnorm}{Blue3} \colorlet{lccong}{Red3} % ------------------------------------------------- % Set up a new layer for the debugging marks, and make sure it is on % top \pgfdeclarelayer{marx} \pgfsetlayers{main,marx} % A macro for marking coordinates (specific to the coordinate naming % scheme used here). Swap the following 2 definitions to deactivate % marks. \providecommand{\cmark}[2][]{% \begin{pgfonlayer}{marx} \node [nmark] at (c#2#1) {#2}; \end{pgfonlayer}{marx} } \providecommand{\cmark}[2][]{\relax} % ------------------------------------------------- % Start the picture \begin{tikzpicture}[% >=triangle 60, % Nice arrows; your taste may be different start chain=going below, % General flow is top-to-bottom node distance=6mm and 60mm, % Global setup of box spacing every join/.style={norm}, % Default linetype for connecting boxes ] % ------------------------------------------------- % A few box styles % <on chain> *and* <on grid> reduce the need for manual relative % positioning of nodes \tikzset{ base/.style={draw, on chain, on grid, align=center, minimum height=4ex}, proc/.style={base, rectangle, text width=8em}, test/.style={base, diamond, aspect=2, text width=5em}, term/.style={proc, rounded corners}, % coord node style is used for placing corners of connecting lines coord/.style={coordinate, on chain, on grid, node distance=6mm and 25mm}, % nmark node style is used for coordinate debugging marks nmark/.style={draw, cyan, circle, font={\sffamily\bfseries}}, % ------------------------------------------------- % Connector line styles for different parts of the diagram norm/.style={->, draw, lcnorm}, free/.style={->, draw, lcfree}, cong/.style={->, draw, lccong}, it/.style={font={\small\itshape}} } % ------------------------------------------------- % Start by placing the nodes \node [proc, densely dotted, it] (p0) {New trigger message thread}; % Use join to connect a node to the previous one \node [term, join] {Trigger scheduler}; \node [proc, join] (p1) {Get quota $k > 1$}; \node [proc, join] {Open queue}; \node [proc, join] {Dispatch message}; \node [test, join] (t1) {Got msg?}; % No join for exits from test nodes - connections have more complex % requirements % We continue until all the blocks are positioned \node [proc] (p2) {$k \mathbin{{-}{=}} 1$}; \node [proc, join] (p3) {Dispatch message}; \node [test, join] (t2) {Got msg?}; \node [test] (t3) {Capacity?}; \node [test] (t4) {$k \mathbin{{-}{=}} 1$}; % We position the next block explicitly as the first block in the % second column. The chain 'comes along with us'. The distance % between columns has already been defined, so we don't need to % specify it. \node [proc, fill=lcfree!25, right=of p1] (p4) {Reset congestion}; \node [proc, join=by free] {Set \textsc{mq} wait flag}; \node [proc, join=by free] (p5) {Dispatch message}; \node [test, join=by free] (t5) {Got msg?}; \node [test] (t6) {Capacity?}; % Some more nodes specifically positioned (we could have avoided this, % but try it and you'll see the result is ugly). \node [test] (t7) [right=of t2] {$k \mathbin{{-}{=}} 1$}; \node [proc, fill=lccong!25, right=of t3] (p8) {Set congestion}; \node [proc, join=by cong, right=of t4] (p9) {Close queue}; \node [term, join] (p10) {Exit trigger message thread}; % ------------------------------------------------- % Now we place the coordinate nodes for the connectors with angles, or % with annotations. We also mark them for debugging. \node [coord, right=of t1] (c1) {}; \cmark{1} \node [coord, right=of t3] (c3) {}; \cmark{3} \node [coord, right=of t6] (c6) {}; \cmark{6} \node [coord, right=of t7] (c7) {}; \cmark{7} \node [coord, left=of t4] (c4) {}; \cmark{4} \node [coord, right=of t4] (c4r) {}; \cmark[r]{4} \node [coord, left=of t7] (c5) {}; \cmark{5} % ------------------------------------------------- % A couple of boxes have annotations \node [above=0mm of p4, it] {(Queue was empty)}; \node [above=0mm of p8, it] {(Queue was not empty)}; % ------------------------------------------------- % All the other connections come out of tests and need annotating % First, the straight north-south connections. In each case, we first % draw a path with a (consistently positioned) annotation node, then % we draw the arrow itself. \path (t1.south) to node [near start, xshift=1em] {$y$} (p2); \draw [*->,lcnorm] (t1.south) -- (p2); \path (t2.south) to node [near start, xshift=1em] {$y$} (t3); \draw [*->,lcnorm] (t2.south) -- (t3); \path (t3.south) to node [near start, xshift=1em] {$y$} (t4); \draw [*->,lcnorm] (t3.south) -- (t4); \path (t5.south) to node [near start, xshift=1em] {$y$} (t6); \draw [*->,lcfree] (t5.south) -- (t6); \path (t6.south) to node [near start, xshift=1em] {$y$} (t7); \draw [*->,lcfree] (t6.south) -- (t7); % ------------------------------------------------- % Now the straight east-west connections. To provide consistent % positioning of the test exit annotations, we have positioned % coordinates for the vertical part of the connectors. The annotation % text is positioned on a path to the coordinate, and then the whole % connector is drawn to its destination box. \path (t3.east) to node [near start, yshift=1em] {$n$} (c3); \draw [o->,lccong] (t3.east) -- (p8); \path (t4.east) to node [yshift=-1em] {$k \leq 0$} (c4r); \draw [o->,lcnorm] (t4.east) -- (p9); % ------------------------------------------------- % Finally, the twisty connectors. Again, we place the annotation % first, then draw the connector \path (t1.east) to node [near start, yshift=1em] {$n$} (c1); \draw [o->,lcfree] (t1.east) -- (c1) |- (p4); \path (t2.east) -| node [very near start, yshift=1em] {$n$} (c1); \draw [o->,lcfree] (t2.east) -| (c1); \path (t4.west) to node [yshift=-1em] {$k>0$} (c4); \draw [*->,lcnorm] (t4.west) -- (c4) |- (p3); \path (t5.east) -| node [very near start, yshift=1em] {$n$} (c6); \draw [o->,lcfree] (t5.east) -| (c6); \path (t6.east) to node [near start, yshift=1em] {$n$} (c6); \draw [o->,lcfree] (t6.east) -| (c7); \path (t7.east) to node [yshift=-1em] {$k \leq 0$} (c7); \draw [o->,lcfree] (t7.east) -- (c7) |- (p9); \path (t7.west) to node [yshift=-1em] {$k>0$} (c5); \draw [*->,lcfree] (t7.west) -- (c5) |- (p5); % ------------------------------------------------- % A last flourish which breaks all the rules \draw [->,MediumPurple4, dotted, thick, shorten >=1mm] (p9.south) -- ++(5mm,-3mm) -- ++(27mm,0) |- node [black, near end, yshift=0.75em, it] {(When message + resources available)} (p0); % ------------------------------------------------- \end{tikzpicture} % ================================================= \end{document}
\documentclass[a4paper,12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} % The face style, can be changed \tikzset{face/.style={shape=circle,minimum size=4ex,shading=radial,outer sep=0pt, inner color=white!50!yellow,outer color= yellow!70!orange}} %% Some commands to make the code easier \newcommand{\emoticon}[1][]{% \node[face,#1] (emoticon) {}; %% The eyes are fixed. \draw[fill=white] (-1ex,0ex) ..controls (-0.5ex,0.2ex)and(0.5ex,0.2ex).. (1ex,0.0ex) ..controls ( 1.5ex,1.5ex)and( 0.2ex,1.7ex).. (0ex,0.4ex) ..controls (-0.2ex,1.7ex)and(-1.5ex,1.5ex).. (-1ex,0ex)--cycle;} \newcommand{\pupils}{ %% standard pupils \fill[shift={(0.5ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.5ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex);} \newcommand{\emoticonname}[1]{ \node[below=1ex of emoticon,font=\footnotesize, minimum width=4cm]{#1};} \begin{document} \begin{tikzpicture} \matrix { \emoticon\pupils\emoticonname{basic} %% mouth \draw[thick] (-1ex,-1ex) ..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); & \emoticon\emoticonname{sad} %% pupils \fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex); %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex); & \emoticon\emoticonname{neutral} %% pupils \fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex); %% mouth \draw[thick] (-0.5ex,-1ex)--(0.5ex,-1ex); \\ \emoticon\pupils\emoticonname{small smile} %% mouth \draw[thick] (-0.5ex,-1ex) ..controls (-0.25ex,-1.25ex)and(0.25ex,-1.25ex)..(0.5ex,-1ex); & \emoticon\pupils\emoticonname{big smile} %% mouth \draw[thick] (-1.5ex,-0.5ex) ..controls (-0.7ex,-1.7ex)and(0.7ex,-1.7ex)..(1.5ex,-0.5ex); & \emoticon\pupils\emoticonname{confused} %% mouth \draw[thick] (-1ex,-0.75ex)--(1ex,-1.25ex); \\ \emoticon\pupils\emoticonname{sexy} %% mouth \draw[very thick,red,line cap=round] (-1ex,-1ex) ..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); %% eyelashes \draw (0.60ex,1.20ex)--(0.60ex,1.60ex) (0.85ex,1.25ex)--(0.95ex,1.45ex) (1.00ex,1.00ex)--(1.20ex,1.10ex) (0.35ex,1.15ex)--(0.25ex,1.35ex) (-0.60ex,1.20ex)--(-0.60ex,1.60ex) (-0.85ex,1.25ex)--(-0.95ex,1.45ex) (-1.00ex,1.00ex)--(-1.20ex,1.10ex) (-0.35ex,1.15ex)--(-0.25ex,1.35ex); & \emoticon\emoticonname{look up} %% pupils \fill[shift={( 0.5ex,1.1ex)},rotate= 80] (0,0) ellipse (0.15ex and 0.15ex); \fill[shift={(-0.5ex,1.1ex)},rotate=100] (0,0) ellipse (0.15ex and 0.15ex); %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); & \emoticon\emoticonname{look down} %% pupils \fill[shift={( 0.5ex,0.25ex)},rotate= 80] (0,0) ellipse (0.15ex and 0.15ex); \fill[shift={(-0.5ex,0.25ex)},rotate=100] (0,0) ellipse (0.15ex and 0.15ex); %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); \\ \emoticon\pupils\emoticonname{angry} %% pupils \fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex); %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex); %% eyebrows \draw[thick] (0.2ex,1.15ex)--(0.5ex,1.6ex)(-0.2ex,1.15ex)--(-0.5ex,1.6ex); & \emoticon\emoticonname{look left} %% pupils \fill[shift={( 0.25ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.95ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex); %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); & \emoticon\emoticonname{look right} %% pupils \fill[shift={( 0.95ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.25ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex); %% mouth \draw[thick] (-1.0ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); \\ \emoticon\pupils\emoticonname{blush} %% mouth \draw[thick] (-0.5ex,-1ex) ..controls (-0.25ex,-1.25ex)and(0.25ex,-1.25ex)..(0.5ex,-1ex); %% blush \shade[shading=radial,inner color=white!50!red, outer color= yellow!80!orange] ( 1ex,-0.5ex) circle (0.4ex); \shade[shading=radial,inner color=white!50!red, outer color= yellow!80!orange] (-1ex,-0.5ex) circle (0.4ex); & \emoticon\pupils\emoticonname{\LaTeX} %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); %% LaTeX \node[fill opacity=0.5,right] at(0.4ex,-1ex){\LaTeX}; & \emoticon\pupils\emoticonname{Ti\emph{k}z} %% mouth \draw[thick] (-0.5ex,-1ex) ..controls (-0.25ex,-1.25ex)and(0.25ex,-1.25ex)..(0.5ex,-1ex); %% Tikz \node[fill opacity=0.5,right] at(0.4ex,-1ex){Ti\emph{k}z}; \\ \emoticon[inner color=white!50!green,outer color=green!70!red] \pupils\emoticonname{martian} %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); & \emoticon[inner color=white!50!red,outer color= red!70!red!90!black] \pupils\emoticonname{devilish} %% mouth \draw[thick,line cap=round] (-1ex,-1ex) ..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex); %% tail \draw[very thick,-stealth,red!90!black] (emoticon.330)--++(330:0.01ex) ..controls (3ex,-3ex)and(3.5ex,1ex)..(4ex,-2ex); %% horns \draw ( emoticon.80)..controls ( 0.6ex,2.4ex)..( 1ex,2.5ex) ..controls ( 0.8ex,2.3ex)..(emoticon.70); \draw (emoticon.100)..controls (-0.6ex,2.4ex)..(-1ex,2.5ex) ..controls (-0.8ex,2.3ex)..(emoticon.110); & \emoticon\emoticonname{almost crying} %% pupils \fill[shift={( 0.5ex,0.5ex)},rotate=105] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.5ex,0.5ex)},rotate= 75] (0,0) ellipse (0.3ex and 0.15ex); %% mouth \draw[thick] (-1ex,-1ex)..controls (-0.5ex,-0.8ex)and(0.5ex,-0.8ex)..(1ex,-1ex); \\ }; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,arrows,decorations.pathmorphing,intersections} \usepackage[font={small,sf},labelfont={bf},labelsep=endash]{caption} \usepackage{sansmath} \begin{document} \begin{center} \sansmath \begin{tikzpicture}[ font=\sffamily, level/.style={black,thick}, sublevel/.style={black,densely dashed}, ionization/.style={black,dashed}, transition/.style={black,->,>=stealth',shorten >=1pt}, radiative/.style={transition,decorate,decoration={snake,amplitude=1.5}}, indirectradiative/.style={radiative,densely dashed}, nonradiative/.style={transition,dashed}, ] \coordinate (sublevel) at (0, 8pt); % Singlet levels \coordinate (S00) at (0, -1); \coordinate (S01) at ($(S00) + (sublevel)$); \coordinate (S02) at ($(S00) + 2*(sublevel)$); \coordinate (S03) at ($(S00) + 3*(sublevel)$); \coordinate (S10) at (0, 3); \coordinate (S11) at ($(S10) + (sublevel)$); \coordinate (S12) at ($(S10) + 2*(sublevel)$); \coordinate (S13) at ($(S10) + 3*(sublevel)$); \coordinate (S20) at (0, 4.5); \coordinate (S21) at ($(S20) + (sublevel)$); \coordinate (S22) at ($(S20) + 2*(sublevel)$); \coordinate (S30) at (0, 6); % Draw main levels \foreach \level/\text in {00/0, 10/1, 20/2, 30/3} \draw[level] (S\level) node[left=20pt] {$S_\text$} node[left] {\footnotesize $S_{\level}$} -- +(4, 0); % Draw sublevels \foreach \sublevel in {01,02,03,11,12,13,21,22} \draw[sublevel] (S\sublevel) node[left] {\footnotesize $S_{\sublevel}$} -- +(4, 0); \node at (2, 6.5) {Singlet}; % Triplet levels \coordinate (T00) at (5, 2); \coordinate (T01) at ($(T00) + (sublevel)$); \coordinate (T02) at ($(T00) + 2*(sublevel)$); \coordinate (T03) at ($(T00) + 3*(sublevel)$); \coordinate (T10) at (5, 3.5); \coordinate (T11) at ($(T10) + (sublevel)$); \coordinate (T12) at ($(T10) + 2*(sublevel)$); \coordinate (T13) at ($(T10) + 3*(sublevel)$); \coordinate (T20) at (5, 5); \coordinate (T21) at ($(T20) + (sublevel)$); % Draw main levels \foreach \level/\text in {00/0, 10/1, 20/2} \draw[level] (T\level) -- +(2, 0) node[right=20pt] {$T_\text$} node[right] {\footnotesize $T_{\level}$}; % Draw sublevels \foreach \sublevel in {01,02,11,12,13,21} \draw[sublevel] (T\sublevel) -- +(2, 0) node[right] {\footnotesize $T_{\sublevel}$}; \node at (6, 6.5) {Triplet}; % Ionization level \draw[ionization] (0, 7.5) node[left=20pt] {$I_\pi$} -- +(7, 0); % Excitations \foreach \i/\from/\to in {1/S00/S10, 2/S00/S11, 3/S00/S12, 4/S00/S13, 5/S00/S20, 6/S00/S21, 7/S00/S22, 8/S00/S30} \draw[transition] ([xshift=\i*5pt] \from) -- ([xshift=\i*5pt] \to); % Radiative decay (fluorescence) \foreach \i/\from/\to in {1/S10/S00, 2/S10/S01, 3/S10/S02, 4/S10/S03} \draw[radiative] ([xshift=(\i+9)*5pt] \from) -- ([xshift=(\i+9)*5pt] \to); % Nonradiative decay (internal degradation) \foreach \i/\from/\to in {1/S11/S10, 2/S12/S10, 3/S13/S10, 4/S20/S10, 5/S21/S10, 6/S22/S10, 7/S30/S10} \draw[nonradiative] ([xshift=(\i+9)*5pt] \from) -- ([xshift=(\i+9)*5pt] \to); % Radiative decay (phosphorescence) % % There is some magic going on to prevent an irritating optical effect. % If the (start) coordinate is taken to be simply (Tstart), the wiggly % lines start at the T00 level. Because of their differing lengths % however, the wiggles start to form a distracting pattern. Therefore, % the lines are extended a bit (-\i*5pt) to show a pleasing effect. They % are clipped so the transition still starts at T00. If you want to % observe the optical effect, include this line at the correct location: % \coordinate (start) at (Tstart); \begin{scope} \clip (S00) -- +(7, 0) |- (T00) -| (S00); \foreach \i/\level in {1/(S00), 2/(S01), 3/(S02), 4/(S03)} { \coordinate (Tstart) at ([xshift=\i*7pt] T00); \coordinate (end) at ($(Tstart) + (-135:4.5)$); \coordinate (start) at ($(Tstart)!-\i*5pt!(end)$); \path[name path=trans] (start) -- (end); \path[name path=ground] \level -- +(5, 0); \draw[indirectradiative,name intersections={of=trans and ground}] (start) -- (intersection-1); } \end{scope} % Labels (curious coordinates are due to manual placement adjustments) \node[left] at (5pt, 1.5) {\footnotesize Absorption}; \node[right,align=center] at (13*5pt, 2cm - 5pt) {\footnotesize Fluorescence\\\footnotesize (fast)}; \node[right,align=center] at (5cm + 5pt, 1cm - 5pt) {\footnotesize Phosphorescence\\\footnotesize (indirect, slow)}; \node[right,fill=white,align=left] at ([xshift=12*5pt] S13) {\footnotesize Internal degradation}; % Intersystem crossing \draw[nonradiative,name path=crossing] ($(S10) + (4, 0) - (5pt, 0)$) -- ([xshift=5pt] T00); \coordinate (crosslabel) at (4.5, 3.1); \node[right,fill=white] at (crosslabel) {\footnotesize Intersystem crossing}; \path[name path=arrow] (crosslabel) -- +(-145:1cm); \draw[->,>=stealth',shorten >=2pt, name intersections={of=crossing and arrow}] (crosslabel) -- (intersection-1); \end{tikzpicture} \captionof{figure}{Typical energy levels for $\pi$-orbitals of a fluor molecule. Spin singlet~($S$) and triplet~($T$) states are separated for clarity. The ionization level $I_\pi$ is shown at the top. Excited states as well as vibrational sublevels (dashed horizontal lines) are shown. Internal degradation is a non-radiative process, while fluorescence and phosphorescence are radiative decays. The decay $T_0 \to S_0$, however, is indirect, by interactions with other molecules.} \end{center} \end{document}
\documentclass{article} \usepackage{tikz} \usepackage{xcolor} \usepackage{etoolbox} \usetikzlibrary{decorations} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{calc} \usetikzlibrary{arrows} \newtoggle{quickdecim} %\toggletrue{quickdecim} % Uncomment this to render more quickly (non-random) \begin{document} \begin{tikzpicture} \def\levels{4} % 2, 3, or 4 \pgfmathtruncatemacro{\blocks}{4^(\levels-1)} \def\maxrand{99} \def\xoffset{1.1} \def\yoffset{2.6} \pgfmathsetseed{31337} \pgfmathsetmacro{\totalwidth}{10} \pgfmathsetmacro{\levelheight}{2.4} \pgfmathsetmacro{\sampleheight}{0.55} \definecolor{lowcolor} {rgb}{0.6,0.6,1} \definecolor{highcolor}{rgb}{0.6,1,0.6} \tikzstyle{Sample} = [ draw, anchor=west, inner sep=0, outer sep=0, minimum height=\sampleheight * 1cm, font=\small, text=black, ] % make random numbers \pgfmathtruncatemacro{\runningrandarray}{random(\maxrand)} \foreach \x[count=\xi from 1] in {2,...,\blocks} { \let\temprand\runningrandarray \pgfmathtruncatemacro{\tempres}{random(\maxrand)} \xdef\runningrandarray{\temprand,\tempres} } \xdef\randarray{{\runningrandarray}} % boxes \foreach \level in {1,...,\levels} { \coordinate (level\level sample0) at (\xoffset - \totalwidth / 2, \yoffset + \levelheight - \levelheight * \level); \pgfmathsetmacro{\avgblocks}{4^(\level-1)} \pgfmathsetmacro{\levelblocks}{\blocks / \avgblocks} \pgfmathsetmacro{\samplewidth}{\totalwidth/\levelblocks} \foreach \i in {1,...,\levelblocks} { \iftoggle{quickdecim}{ % can do this instead of using real samples, for speed \xdef\smin{5} \xdef\smean{50} \xdef\smax{95} }{ % calculate sample values from the randarray \pgfmathsetmacro{\smin}{100} \pgfmathsetmacro{\smax}{0} \pgfmathsetmacro{\samplesum}{0} \pgfmathsetmacro{\countfrom}{(\i - 1) * \avgblocks} \pgfmathsetmacro{\countto}{\countfrom + \avgblocks - 1} \foreach \j in {\countfrom,...,\countto} { \pgfmathsetmacro{\tmp}{\samplesum + \randarray[\j] / \avgblocks} \xdef\samplesum{\tmp} \pgfmathtruncatemacro{\tmp}{min(\smin, \randarray[\j])} \xdef\smin{\tmp} \pgfmathtruncatemacro{\tmp}{max(\smax, \randarray[\j])} \xdef\smax{\tmp} }; \pgfmathtruncatemacro{\tmp}{\samplesum} \xdef\smean{\tmp} } \pgfmathtruncatemacro{\cmin}{(\smin - 1) / (\maxrand - 1) * 100} \pgfmathtruncatemacro{\cmean}{(\smean - 1) / (\maxrand - 1) * 100} \pgfmathtruncatemacro{\cmax}{(\smax - 1) / (\maxrand - 1) * 100} \pgfmathtruncatemacro{\prev}{\i-1} \ifnumequal{\level}{1}{ \node[Sample, xshift=\samplewidth * \prev cm, draw, yshift=\sampleheight * -2cm, minimum width=\samplewidth cm, fill=highcolor!\cmean!lowcolor] (level\level samplemax\i) at (level\level sample0) {}; \coordinate (level\level samplemin\i) at (level\level samplemax\i); \coordinate (level\level samplemean\i) at (level\level samplemax\i); }{ \node[Sample, xshift=\samplewidth * \prev cm, draw, yshift=\sampleheight * 0cm, minimum width=\samplewidth cm, fill=highcolor!\cmin!lowcolor] (level\level samplemin\i) at (level\level sample0) {\smin}; \node[Sample, xshift=\samplewidth * \prev cm, draw, yshift=\sampleheight * -1cm, minimum width=\samplewidth cm, fill=highcolor!\cmean!lowcolor] (level\level samplemean\i) at (level\level sample0) {\smean}; \node[Sample, xshift=\samplewidth * \prev cm, draw, yshift=\sampleheight * -2cm, minimum width=\samplewidth cm, fill=highcolor!\cmax!lowcolor] (level\level samplemax\i) at (level\level sample0) {\smax}; } }; \coordinate (level\level sampleminlabel) at (level\level samplemin\levelblocks); \coordinate (level\level samplemeanlabel) at (level\level samplemean\levelblocks); \coordinate (level\level samplemaxlabel) at (level\level samplemax\levelblocks); }; % arrows \foreach \next in {2,...,\levels} { \pgfmathtruncatemacro{\level}{\next-1} \pgfmathsetmacro{\amplitude}{3pt * \level + 1.5pt} \pgfmathsetmacro{\thislevelblocks}{\blocks / (4^(\level-1))} \pgfmathsetmacro{\nextlevelblocks}{\blocks / (4^(\level))} \foreach \block in {1,...,\nextlevelblocks} { \pgfmathtruncatemacro{\a}{4*(\block-1)+1} \pgfmathtruncatemacro{\b}{4*(\block-1)+4} \pgfmathtruncatemacro{\c}{4*(\block-1)+2} \draw [thick, decorate, decoration={brace, amplitude=\amplitude, mirror}] ([xshift=0.5pt]level\level samplemax\a.south west) -- ([xshift=-0.5pt]level\level samplemax\b.south east); \draw[thick, -stealth] ([yshift=-\amplitude]level\level samplemax\c.south east) -- (level\next samplemin\block .north); }; }; % text \foreach \level in {1,...,\levels} { \pgfmathtruncatemacro{\decim}{(4^(\level - 1))} % Level N \node[xshift=-2.5cm, yshift=6pt, anchor=west] (foo) at ($(level\level sample0 |- level\level samplemean1)$) {Level \level}; % Samples \node[anchor=north, inner sep=0, font=\footnotesize] at (foo.south) {\ifnumequal{\level}{1}{(${\color{red}N}$ values)} {($3\cdot {\color{red}N / \decim}$ values)}}; }; \begin{scope}[anchor=west, inner sep=0, font=\footnotesize\itshape, text depth=0ex, text height=1.1ex, draw] \foreach \level in {2,...,\levels} { \node[xshift=3pt] at (level\level sampleminlabel) { min }; \node[xshift=3pt] at (level\level samplemeanlabel) { mean }; \node[xshift=3pt] at (level\level samplemaxlabel) { max }; }; \end{scope} \node[yshift=-0.8cm] at (foo.south) { $\vdots$ }; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \def\pgfdecorationgrowthstart{0cm} \def\pgfdecorationgrowthendsizelist{0cm} \def\pgfdecorationgrowthwavelengthlist{0cm} \def\pgfdecorationgrowthendstepslist{1} \def\pgfdecorationgrowthendstep{1} \newif\ifpgfdecorationgrowthsine \newif\ifpgfdecorationgrowthcosine \newif\ifpgfdecorationonewavelength \pgfdecorationgrowthcosinefalse \pgfdecorationgrowthsinetrue \pgfkeys{% /pgf/decoration/.cd, growth start size/.initial=0.5cm, growth end size/.initial=3cm, growth end steps/.initial=1, growth wave length/.initial=3pt, growth sine/.code={\pgfdecorationgrowthsinetrue\pgfdecorationgrowthcosinefalse}, growth cosine/.code={\pgfdecorationgrowthsinefalse\pgfdecorationgrowthcosinetrue} } \def\pgfdecorationgrowthsetup{% \global\edef\pgfdecorationgrowthstart{\pgfkeysvalueof{/pgf/decoration/growth start size}}% \global\edef\pgfdecorationgrowthendsizelist{\pgfkeysvalueof{/pgf/decoration/growth end size}}% \global\edef\pgfdecorationgrowthendstepslist{\pgfkeysvalueof{/pgf/decoration/growth end steps}}% \global\edef\pgfdecorationgrowthwavelengthlist{\pgfkeysvalueof{/pgf/decoration/growth wave length}}% } \def\pgfdecorationgrowthsteps{1} % To keep track of steps from ending \def\pgfdecorationliststeps{2} % To keep track of list items from ending, has to start from 2 \pgfdeclaredecoration{growth wave}{initial}% { \state{initial}[width=0pt,next state=first] {% \pgfdecorationgrowthsetup% \pgfpathlineto{\pgfqpoint{0pt}{0pt}}% \global\edef\pgfdecorationgrowthsteps{0}% \global\edef\pgfdecorationliststeps{2}% \foreach \endsize in \pgfdecorationgrowthendsizelist {% \global\edef\pgfdecorationgrowthendsize{\endsize}% \breakforeach% }% \foreach \growthstep in \pgfdecorationgrowthendstepslist {% \global\edef\pgfdecorationgrowthendstep{\growthstep}% \breakforeach% }% \foreach \wavelength in \pgfdecorationgrowthwavelengthlist {% \global\edef\pgfdecorationgrowthwavelength{\wavelength}% \breakforeach% }% \pgfmathparse{(\pgfdecorationgrowthendsize - \pgfdecorationgrowthstart) * 2 * % \pgfdecorationgrowthwavelength / ( \pgfdecoratedremainingdistance * \pgfdecorationgrowthendstep)}% \global\edef\pgfdecorationgrowth{\pgfmathresult}% }% \state{first}[width=2*\pgfdecorationgrowthwavelength,next state=second] {% \pgfdecorationgrowthstepcounters% \pgfmathparse{\pgfdecorationgrowthstart + \pgfdecorationgrowthsteps * \pgfdecorationgrowth}% % The wave starts \ifpgfdecorationgrowthsine% \pgfpathsine{\pgfqpoint{\pgfdecorationgrowthwavelength}{\pgfmathresult pt}}% \pgfpathcosine{\pgfqpoint{\pgfdecorationgrowthwavelength}{-\pgfmathresult pt}}% \fi% \ifpgfdecorationgrowthcosine% \pgfpathsine{\pgfqpoint{\pgfdecorationgrowthwavelength}{-\pgfmathresult pt}}% \pgfpathcosine{\pgfqpoint{\pgfdecorationgrowthwavelength}{\pgfmathresult pt}}% \fi% \pgfdecorationgrowthstateend% }% \state{second}[width=2*\pgfdecorationgrowthwavelength,next state=first] {% \pgfdecorationgrowthstepcounters% \pgfmathparse{\pgfdecorationgrowthstart + \pgfdecorationgrowthsteps * \pgfdecorationgrowth}% % The wave continues \ifpgfdecorationgrowthsine% \pgfpathsine{\pgfqpoint{\pgfdecorationgrowthwavelength}{-\pgfmathresult pt}}% \pgfpathcosine{\pgfqpoint{\pgfdecorationgrowthwavelength}{\pgfmathresult pt}}% \fi% \ifpgfdecorationgrowthcosine% \pgfpathsine{\pgfqpoint{\pgfdecorationgrowthwavelength}{\pgfmathresult pt}}% \pgfpathcosine{\pgfqpoint{\pgfdecorationgrowthwavelength}{-\pgfmathresult pt}}% \fi% \pgfdecorationgrowthstateend% } \state{final} {% \pgfpathlineto{\pgfpointdecoratedpathlast}% }% } \def\pgfdecorationgrowthstateend{% \pgfmathadd{\pgfdecorationgrowthsteps}{1}% \global\edef\pgfdecorationgrowthsteps{\pgfmathresult} % Redefine the steps counter, globally. } \def\pgfdecorationgrowthstepcounters{% \pgfmathparse{\pgfdecorationgrowthendstep * \pgfdecoratedpathlength} \ifdim\pgfdecoratedcompleteddistance>\pgfmathresult pt% \foreach \endsize [count=\count] in \pgfdecorationgrowthendsizelist {% \ifnum\count=\pgfdecorationliststeps% \global\edef\pgfdecorationgrowthendsize{\endsize}% \breakforeach% \else% \global\edef\pgfdecorationgrowthstart{\endsize}% \fi% }% \global\edef\tempa{0}% \foreach \growthstep [count=\count] in \pgfdecorationgrowthendstepslist {% \ifnum\count=\pgfdecorationliststeps% \global\edef\pgfdecorationgrowthendstep{\growthstep}% \breakforeach% \else% \global\edef\tempa{\growthstep}% \fi% }% \foreach \wavelength [count=\count] in \pgfdecorationgrowthwavelengthlist {% \ifnum\count=\pgfdecorationliststeps% \global\edef\pgfdecorationgrowthwavelength{\wavelength}% \breakforeach% \fi% }% \pgfmathparse{int(\pgfdecorationliststeps+1)}% \global\edef\pgfdecorationliststeps{\pgfmathresult}% \global\edef\pgfdecorationgrowthsteps{0}% Redefine the steps counter, globally. \pgfmathparse{(\pgfdecorationgrowthendsize-\pgfdecorationgrowthstart) * 2 % * \pgfdecorationgrowthwavelength / (\pgfdecoratedpathlength * (\pgfdecorationgrowthendstep -\tempa))}% \global\edef\pgfdecorationgrowth{\pgfmathresult}% \fi% } \begin{document} \begin{tikzpicture} \draw[decorate,decoration={growth wave, growth start size=2pt, growth end size=.5cm, growth wave length=5pt, growth cosine}] (0,0) -- (3,0); \draw[decorate,decoration={growth wave, growth start size=0pt, growth end size=.5cm, growth wave length=2pt, growth cosine},fill,color=red] (0,-1) rectangle (4,-4); \foreach \start/\end/\xstep/\ystep in {0/-10/5/-5,5/-5/10/-10,10/-10/5/-15,5/-15/0/-10} { \draw[fill,color=red,decorate,decoration={growth wave, % Choose the decoration growth start size=1pt, % Sets the start amplitude of the wave growth end size={1cm,3cm,1cm,1pt}, % Sets the end amplitude of the wave growth end steps={0.25,.5,.75,1}, % Sets the percentual path positions where the transitions % should be made growth wave length={1pt,3pt,3pt,1pt},% Sets the wave lengths growth sine}] % The wave starts as a sine (\start,\end) -- (\xstep,\ystep); \draw[fill,color=blue,decorate,decoration={growth wave, % Choose the decoration growth start size=1pt, % Sets the start amplitude of the wave growth end size={1cm,3cm,1cm,1pt}, % Sets the end amplitudes of the wave growth end steps={0.25,.5,.75,1}, % Sets the percentual path positions where the transitions % should be made growth wave length={1pt,3pt,3pt,1pt},% Sets the wave lengths growth cosine}] % The wave starts as a cosine (\start,\end) -- (\xstep,\ystep); } \draw[xshift=5cm, decorate,decoration={growth wave, growth start size=1cm, growth end size=1pt, growth wave length=2pt, growth cosine},fill,color=red] (0,0) -- (3,0); \end{tikzpicture} \end{document}
\documentclass[tikz]{standalone} \usepackage{luacode} \usepackage{tikz-3dplot} \definecolor{endermanblack}{HTML}{000000} \definecolor{endermangray}{HTML}{161616} %\definecolor{endermanpurple}{HTML}{CC00FA} %\definecolor{endermanlightpurple}{HTML}{E079FA} \definecolor{endermanpurple}{HTML}{FF9EFF} \definecolor{endermanlightpurple}{HTML}{FFC9FF} \definecolor{particlecolor}{HTML}{DF4AF8} \begin{luacode*} function draw_coordinate_system() tex.sprint("\\draw[white!50!gray,thick,->] (0,0,0) -- " .. "(3,0,0) node[text=white!50!gray,anchor=north east]{$x$};") tex.sprint("\\draw[white!50!gray,thick,->] (0,0,0) -- " .. "(0,3,0) node[text=white!50!gray,anchor=west]{$y$};") tex.sprint("\\draw[white!50!gray,thick,->] (0,0,0) -- " .. "(0,0,3) node[text=white!50!gray,anchor=south]{$z$};") end function matrix_scalar_multiplication(matrix, scalar) local rows = #matrix local cols = #matrix[1] local tmp_matrix = {} for i = 1, rows do tmp_matrix[i] = {} for j = 1, cols do tmp_matrix[i][j] = matrix[i][j] * scalar end end return tmp_matrix end function shift_coordinates(matrix, array) local matrix_rows = #matrix local matrix_cols = #matrix[1] local array_length = #array local tmp_matrix = {} if matrix_cols == array_length then for i = 1, matrix_rows do tmp_matrix[i] = {} for j = 1, matrix_cols do tmp_matrix[i][j] = matrix[i][j] + array[j] end end return tmp_matrix else return nil end end function tikzcube(x, y, z, color) local side_1 = {{1, 1, -1}, {-1, 1, -1}, {-1, -1, -1}, {1, -1, -1}} local side_2 = {{-1, 1, -1}, {-1, 1, 1}, {-1, -1, 1}, {-1, -1, -1}} local side_3 = {{-1, -1, -1}, {1, -1, -1}, {1, -1, 1}, {-1, -1, 1}} local side_4 = {{1, 1, -1}, {-1, 1, -1}, {-1, 1, 1}, {1, 1, 1}} local side_5 = {{1, -1, -1}, {1, 1, -1}, {1, 1, 1}, {1, -1, 1}} local side_6 = {{1, 1, 1}, {-1, 1, 1}, {-1, -1, 1}, {1, -1, 1}} local cube_sides = {side_1, side_2, side_3, side_4, side_5, side_6} local tex_cube = "" for i = 1, #cube_sides do tex_cube = tex_cube .. "\\draw[ultra thin, fill=" .. color .. "] " local current_side = matrix_scalar_multiplication(cube_sides[i], 0.5) current_side = shift_coordinates(current_side, {x, y, z}) local current_side_rows = #current_side local current_side_cols = #current_side[1] for j = 1, current_side_rows do for k = 1, current_side_cols do if k == 1 then tex_cube = tex_cube .. "(" end tex_cube = tex_cube .. current_side[j][k] if k ~= current_side_cols then tex_cube = tex_cube .. ", " else tex_cube = tex_cube .. ") -- " end end end tex_cube = tex_cube .. "cycle;" end tex.sprint(tex_cube) end function draw_head(x_pos, y_pos, z_pos) local color for x = x_pos, x_pos + 7, 1 do for y = y_pos, y_pos + 7, 1 do for z = z_pos, z_pos + 6, 1 do if (x == x_pos or x == x_pos + 7 or y == y_pos or y == y_pos + 7 or z == z_pos or z == z_pos + 6) and not (x == x_pos + 7 and y > y_pos and y < y_pos + 7 and z == z_pos) then if x == x_pos + 7 and (y == y_pos or y == y_pos + 2 or y == y_pos + 5 or y == y_pos + 7) and z == z_pos + 2 then tikzcube(x, y, z, "endermanlightpurple") elseif x == x_pos + 7 and (y == y_pos + 1 or y == y_pos + 6) and z == z_pos + 2 then tikzcube(x, y, z, "endermanpurple") else if math.random(0, 8) < 6 then color = "endermangray" else color = "endermanblack" end tikzcube(x, y, z, color) end end end end end end function draw_bodypart(x_pos, y_pos, z_pos, x_length, y_length, z_length) local color for x = x_pos, x_pos + x_length - 1, 1 do for y = y_pos, y_pos + y_length - 1, 1 do for z = z_pos, z_pos + z_length - 1, 1 do if x == x_pos or x == x_pos + x_length - 1 or y == y_pos or y == y_pos + y_length - 1 or z == z_pos or z == z_pos + z_length - 1 then if math.random(0, 8) < 6 then color = "endermangray" else color = "endermanblack" end tikzcube(x, y, z, color) end end end end end function draw_particles(x_min, x_max, y_min, y_max, z_min, z_max) local x local y local z local black_amount local particle_size local particle_scale local particle_count = math.random(30, 40) local particle for i = 1, particle_count, 1 do x = math.random(x_min, x_max) y = math.random(y_min, y_max) z = math.random(z_min, z_max) particle_size = math.random(1, 8) particle_scale = math.random(20, 100) / 100 black_amount = math.random(0, 25) tex.sprint("\\tdplottransformmainscreen{" .. x .. "}{" .. y .. "}{" .. z .. "}") for i = 0, particle_size - 1, 1 do for j = 0, particle_size - 1, 1 do if math.random(0, 1) == 0 and ((i ~= 0 and j ~= 0) and (i ~= particle_size - 1 and j ~= 0) and (j ~= particle_size - 1 and i ~= 0) and (i ~= particle_size - 1 and j ~= particle_size - 1)) then particle = "\\filldraw[black!" .. black_amount .. "!particlecolor, tdplot_screen_coords] (" .. i * particle_scale * 0.25 .. "+\\tdplotresx, " .. j * particle_scale * 0.25 .. "+\\tdplotresy) " .. "rectangle +(" .. particle_scale .. "*0.25, " .. particle_scale .. "*0.25);" tex.sprint(particle) end end end end end function draw_enderman(x_rotation, z_rotation) tex.sprint("\\tdplotsetmaincoords{" .. x_rotation .. "}{" .. z_rotation .. "}") tex.sprint("\\begin{tikzpicture}[tdplot_main_coords]") math.randomseed(os.time()) draw_bodypart(3, -2, -30, 2, 2, 30) -- right arm draw_bodypart(3, 1, -42, 2, 2, 30) -- right leg draw_bodypart(3, 5, -42, 2, 2, 30) -- left leg draw_bodypart(2, 0, -12, 4, 8, 12) -- body draw_bodypart(3, 8, -30, 2, 2, 30)-- left arm draw_head(0, 0, 0) -- head draw_particles(-10, 10, -10, 10, -44, 10) -- draw_coordinate_system() tex.sprint("\\end{tikzpicture}") end \end{luacode*} \begin{document} \luadirect{draw_enderman(70, 130)} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,shadows,calc} \usepgflibrary{arrows} \newcommand{\A}{\mathcal{A}} \newcommand{\K}{\mathcal{K}} \newcommand{\M}{\mathcal{M}} \newcommand{\T}{\mathcal{T}} \tikzset{ sshadow/.style={opacity=.25, shadow xshift=0.05, shadow yshift=-0.06}, } %-----#1 size, #2 angle, #3 aspect, #4 label next to the diamond %-----#5 name of the node, #6 coordinate, #7 label \def\schemel[#1,#2,#3,#4,#5,#6]#7{ % \node[draw, diamond, shape aspect=#3, rotate=#2, minimum size=#1, % bottom color=green!55, top color=green!25, color=green!65!black, % drop shadow={sshadow,color=green!60!black}, #4] (#5) at #6 {\textcolor{green!40}{bla}}; % \node at #6 {#7};% } \def\schemer[#1,#2,#3,#4,#5,#6]#7{ % \node[draw, diamond, shape aspect=#3, rotate=#2, minimum size=#1, % bottom color=green!65, top color=green!30, color=green!60!black, % drop shadow={sshadow,color=green!65!black}, #4] (#5) at #6 {\textcolor{green!53}{bla}}; % \node at #6 {#7}; % } %-----TBoxes %-----#1 height, #2 width, #3 anchor for the label, #4 name of the node, #5 %-----coordinate, #6 label \def\tboxl[#1,#2,#3,#4,#5]#6{% \node[draw, drop shadow={opacity=.35}, minimum height=#1, minimum width=#2, % inner color=blue!45, outer color=blue!55, color=blue!40!black] (#4) at #5 {}; % \node[anchor=#3,inner sep=2pt] at (#4.#3) {#6};% } \def\tboxr[#1,#2,#3,#4,#5]#6{% \node[draw, drop shadow={opacity=.35}, minimum height=#1, minimum width=#2, % inner color=blue!35, outer color=blue!45, color=blue!50!black] (#4) at #5 {}; % \node[anchor=#3,inner sep=2pt] at (#4.#3) {#6}; % } %-----#1 name of the node, #2 coordinate, #3 label \def\entity[#1,#2]#3;{ \node[draw,drop shadow={opacity=.4,shadow xshift=0.04, shadow yshift=-0.04},color=blue!30!black,fill=white,rounded corners=3] (#1) at #2 {#3}; } %-----#1 from node, #2 to node, #3 specification of a node (label), #4 %-----dashed, or other parameters for draw \def\isaedge[#1,#2,#3,#4];{ \draw[-triangle 60,color=black!20!black,#4,fill=white] (#1) -- #3 (#2); } %-----ABoxes %-----#1 height, #2 width, #3 aspect, #4 name of the node, #5 %-----coordinate, #6 label \def\aboxl[#1,#2,#3,#4,#5]#6{% \node[draw, cylinder, alias=cyl, shape border rotate=90, aspect=#3, % minimum height=#1, minimum width=#2, outer sep=-0.5\pgflinewidth, % color=orange!40!black, left color=orange!70, right color=orange!80, middle color=white] (#4) at #5 {};% \node at #5 {#6};% \fill [orange!30] let \p1 = ($(cyl.before top)!0.5!(cyl.after top)$), \p2 = (cyl.top), \p3 = (cyl.before top), \n1={veclen(\x3-\x1,\y3-\y1)}, \n2={veclen(\x2-\x1,\y2-\y1)} in (\p1) ellipse (\n1 and \n2); } \def\aboxr[#1,#2,#3,#4,#5]#6{% \node[draw, cylinder, alias=cyl, shape border rotate=90, aspect=#3, % minimum height=#1, minimum width=#2, outer sep=-0.5\pgflinewidth, % color=orange!50!black, left color=orange!50, right color=orange!60, middle color=white] (#4) at #5 {};% \node at #5 {#6};% \fill [orange!20] let \p1 = ($(cyl.before top)!0.5!(cyl.after top)$), \p2 = (cyl.top), \p3 = (cyl.before top), \n1={veclen(\x3-\x1,\y3-\y1)}, \n2={veclen(\x2-\x1,\y2-\y1)} in (\p1) ellipse (\n1 and \n2); } %-----#1 height, #2 width, #3 name of the node, #4 %-----coordinate, #5 label \def\kbbox[#1,#2,#3,#4,#5]#6{ \draw[dashed] node[draw,color=gray!50,minimum height=#1,minimum width=#2] (#4) at #5 {}; \node[anchor=#3,inner sep=2pt] at (#4.#3) {#6}; } %-----#1 from node, #2 to node, #3 specification of a node (label), #4 %-----dashed, or other parameters for draw \def\soledge[#1,#2,#3,#4];{ \draw[dashed,-latex,#4] (#1) -- #3 (#2); } \begin{document} \begin{tikzpicture} \small % schemas \schemel[30,23,4,label=below:{source signature},p1,(0,5)] {$\Sigma_1$}; \schemer[25,23,3,label=below:{target signature},p2,(6,5)] {$\Sigma_2$}; \draw[-latex] (p1) .. node[above] {$\M$} controls (2.5,6) and (3.5,6) .. (p2); % source KB \kbbox[144,94,south,k1,(0,1.25)] {source KB $\K_1$}; \tboxl[60,80,north east,t1,(0,2.5)] {$\T_1$}; \entity[A1,(-0.9,3.1)] {$A_1$}; \entity[B1,(-0.4,1.9)] {$B_1$}; \entity[C1,(0.9,1.9)] {$C_1$}; \entity[D1,(0.4,3.1)] {$D_1$}; \isaedge[B1,A1,,]; \isaedge[C1,B1,,]; \isaedge[C1,D1,,]; \aboxl[45,40,1.6,a1,(0,0)] {$\A_1$}; % target KB \kbbox[144,84,south,k2,(6,1.25)] {target KB $\K_2$}; \tboxr[60,70,north east,t2,(6,2.5)] {$\T_2$}; \entity[A2,(6,3.1)] {$A_2$}; \entity[B2,(5.3,1.9)] {$B_2$}; \entity[C2,(6.7,1.9)] {$C_2$}; \isaedge[B2,A2,,]; \isaedge[C2,B2,,]; \aboxr[40,50,1.4,a2,(6,0)] {$\A_2$}; \soledge[k1,k2,,dashed]; \end{tikzpicture} \end{document}
\documentclass[a4paper,10pt]{article} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[ansinew]{inputenc} \usepackage{lmodern} % font definition \usepackage{amsmath} % math fonts \usepackage{amsthm} \usepackage{amsfonts} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} % noisy shapes \usetikzlibrary{fit} % fitting shapes to coordinates \usetikzlibrary{backgrounds} % drawing the background after the foreground \begin{document} \begin{figure}[htbp] \centering % The state vector is represented by a blue circle. % "minimum size" makes sure all circles have the same size % independently of their contents. \tikzstyle{state}=[circle, thick, minimum size=1.2cm, draw=blue!80, fill=blue!20] % The measurement vector is represented by an orange circle. \tikzstyle{measurement}=[circle, thick, minimum size=1.2cm, draw=orange!80, fill=orange!25] % The control input vector is represented by a purple circle. \tikzstyle{input}=[circle, thick, minimum size=1.2cm, draw=purple!80, fill=purple!20] % The input, state transition, and measurement matrices % are represented by gray squares. % They have a smaller minimal size for aesthetic reasons. \tikzstyle{matrx}=[rectangle, thick, minimum size=1cm, draw=gray!80, fill=gray!20] % The system and measurement noise are represented by yellow % circles with a "noisy" uneven circumference. % This requires the TikZ library "decorations.pathmorphing". \tikzstyle{noise}=[circle, thick, minimum size=1.2cm, draw=yellow!85!black, fill=yellow!40, decorate, decoration={random steps, segment length=2pt, amplitude=2pt}] % Everything is drawn on underlying gray rectangles with % rounded corners. \tikzstyle{background}=[rectangle, fill=gray!10, inner sep=0.2cm, rounded corners=5mm] \begin{tikzpicture}[>=latex,text height=1.5ex,text depth=0.25ex] % "text height" and "text depth" are required to vertically % align the labels with and without indices. % The various elements are conveniently placed using a matrix: \matrix[row sep=0.5cm,column sep=0.5cm] { % First line: Control input & \node (u_k-1) [input]{$\mathbf{u}_{k-1}$}; & & \node (u_k) [input]{$\mathbf{u}_k$}; & & \node (u_k+1) [input]{$\mathbf{u}_{k+1}$}; & \\ % Second line: System noise & input matrix \node (w_k-1) [noise] {$\mathbf{w}_{k-1}$}; & \node (B_k-1) [matrx] {$\mathbf{B}$}; & \node (w_k) [noise] {$\mathbf{w}_k$}; & \node (B_k) [matrx] {$\mathbf{B}$}; & \node (w_k+1) [noise] {$\mathbf{w}_{k+1}$}; & \node (B_k+1) [matrx] {$\mathbf{B}$}; & \\ % Third line: State & state transition matrix \node (A_k-2) {$\cdots$}; & \node (x_k-1) [state] {$\mathbf{x}_{k-1}$}; & \node (A_k-1) [matrx] {$\mathbf{A}$}; & \node (x_k) [state] {$\mathbf{x}_k$}; & \node (A_k) [matrx] {$\mathbf{A}$}; & \node (x_k+1) [state] {$\mathbf{x}_{k+1}$}; & \node (A_k+1) {$\cdots$}; \\ % Fourth line: Measurement noise & measurement matrix \node (v_k-1) [noise] {$\mathbf{v}_{k-1}$}; & \node (H_k-1) [matrx] {$\mathbf{H}$}; & \node (v_k) [noise] {$\mathbf{v}_k$}; & \node (H_k) [matrx] {$\mathbf{H}$}; & \node (v_k+1) [noise] {$\mathbf{v}_{k+1}$}; & \node (H_k+1) [matrx] {$\mathbf{H}$}; & \\ % Fifth line: Measurement & \node (z_k-1) [measurement] {$\mathbf{z}_{k-1}$}; & & \node (z_k) [measurement] {$\mathbf{z}_k$}; & & \node (z_k+1) [measurement] {$\mathbf{z}_{k+1}$}; & \\ }; % The diagram elements are now connected through arrows: \path[->] (A_k-2) edge[thick] (x_k-1) % The main path between the (x_k-1) edge[thick] (A_k-1) % states via the state (A_k-1) edge[thick] (x_k) % transition matrices is (x_k) edge[thick] (A_k) % accentuated. (A_k) edge[thick] (x_k+1) % x -> A -> x -> A -> ... (x_k+1) edge[thick] (A_k+1) (x_k-1) edge (H_k-1) % Output path x -> H -> z (H_k-1) edge (z_k-1) (x_k) edge (H_k) (H_k) edge (z_k) (x_k+1) edge (H_k+1) (H_k+1) edge (z_k+1) (v_k-1) edge (z_k-1) % Output noise v -> z (v_k) edge (z_k) (v_k+1) edge (z_k+1) (w_k-1) edge (x_k-1) % System noise w -> x (w_k) edge (x_k) (w_k+1) edge (x_k+1) (u_k-1) edge (B_k-1) % Input path u -> B -> x (B_k-1) edge (x_k-1) (u_k) edge (B_k) (B_k) edge (x_k) (u_k+1) edge (B_k+1) (B_k+1) edge (x_k+1) ; % Now that the diagram has been drawn, background rectangles % can be fitted to its elements. This requires the TikZ % libraries "fit" and "background". % Control input and measurement are labeled. These labels have % not been translated to English as "Measurement" instead of % "Messung" would not look good due to it being too long a word. \begin{pgfonlayer}{background} \node [background, fit=(u_k-1) (u_k+1), label=left:Entrance:] {}; \node [background, fit=(w_k-1) (v_k-1) (A_k+1)] {}; \node [background, fit=(z_k-1) (z_k+1), label=left:Measure:] {}; \end{pgfonlayer} \end{tikzpicture} \caption{Kalman filter system model} \end{figure} This is the system model of the (linear) Kalman filter. At each time step the state vector $\mathbf{x}_k$ is propagated to the new state estimation $\mathbf{x}_{k+1}$ by multiplication with the constant state transition matrix $\mathbf{A}$. The state vector $\mathbf{x}_{k+1}$ is additionally influenced by the control input vector $\mathbf{u}_{k+1}$ multiplied by the input matrix $\mathbf{B}$, and the system noise vector $\mathbf{w}_{k+1}$. The system state cannot be measured directly. The measurement vector $\mathbf{z}_k$ consists of the information contained within the state vector $\mathbf{x}_k$ multiplied by the measurement matrix $\mathbf{H}$, and the additional measurement noise $\mathbf{v}_k$. \end{document}
\documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{arrows,calc} %%% Macro's for 3D figures %%% \newcommand\pgfmathsinandcos[3]{% \pgfmathsetmacro#1{sin(#3)}% \pgfmathsetmacro#2{cos(#3)}% } \newcommand\LongitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % azimuth \tikzset{#1/.estyle={cm={\cost,\sint*\sinEl,0,\cosEl,(0,0)}}} } \newcommand\LatitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % latitude \pgfmathsetmacro\yshift{\cosEl*\sint} \tikzset{#1/.estyle={cm={\cost,0,0,\cost*\sinEl,(0,\yshift)}}} % } \newcommand\DrawLongitudeCircle[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane] (\angVis:1) arc (\angVis:\angVis+180:1); \draw[current plane,dashed] (\angVis-180:1) arc (\angVis-180:\angVis:1); } \newcommand\DrawLatitudeCircle[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} \draw[current plane] (\angVis:1) arc (\angVis:-\angVis-180:1); \draw[current plane,dashed] (180-\angVis:1) arc (180-\angVis:\angVis:1); } \begin{document} \begin{tikzpicture}[scale=1.0, %Option for nice arrows% >=latex,% inner sep=0pt,% outer sep=2pt,% mark coordinate/.style={outer sep=0pt, minimum size=3pt, fill=black,circle}% ] %% some definitions \def\R{0.5} % sphere radius \def\angEl{30} % elevation angle \def\angAz{-140} % azimuth angle \def\angPhi{-105} % longitude of point \def\angBeta{55} % latitude of point \def\angGam{-190} % longitude of point %% working planes \pgfmathsetmacro\H{\R*cos(\angEl)} % Distance to north pole \LongitudePlane[xzplane]{\angEl}{\angAz} % x-axis plane % \coordinate (O) at (0,0); % \begin{scope}[rotate around={-11.1:(0,0)}, field line/.style={color=red, smooth, variable=\t, samples at={0,-5,-10,...,-360}} ] \clip[rotate around={11.1:(0,0)}] (-7,5) rectangle (7,-5); % Computes a point on a field line given r and t \newcommand{\fieldlinecurve}[2]{% {(pow(#1,2))*(3*cos(#2)+cos(3*#2))}, {(pow(#1,2))*(sin(#2)+sin(3*#2))}% } % Longitudinal plnaes \foreach \u in {0,-40,...,-160}{ \LongitudePlane[{{\u}zplane}]{\angEl}{\u} \foreach \r in {0.25,0.5,...,2.25} { \draw[{{\u}zplane}, field line] plot (\fieldlinecurve{\r}{\t}); } } \foreach \u in {-200,-240,...,-320}{ \LongitudePlane[{{\u}zplane}]{\angEl}{\u} \foreach \r in {0.25,0.5,...,2.25}{ \draw[{{\u}zplane}, dashed, field line] plot (\fieldlinecurve{\r}{\t}); } } % Drawing plane for the B-vectors \LongitudePlane[bzplane]{\angEl}{0} \foreach \r in {0.25,0.5,...,2.25}{ \draw[bzplane, thick, field line] plot (\fieldlinecurve{\r}{\t}); } \begin{scope}[bzplane, very thick, ->, >=stealth] \draw (\fieldlinecurve{1.25}{-30}) -- +(-30:0.79cm) node[right] {$\vec{B_{r}}$}; \draw (\fieldlinecurve{1.25}{-30}) -- +(60:0.68cm) node[right] {$\vec{B_{\theta}}$}; \draw (\fieldlinecurve{1.25}{30}) -- +(-150:0.79cm) node[below] {$\vec{B_{r}}$}; \draw (\fieldlinecurve{1.25}{30}) -- +(120:0.68cm) node[above] {$\vec{B_{\theta}}$}; \end{scope} % \begin{scope}[rotate around={11.1:(0,0)}] \fill[ball color=white,opacity=0.3] (O) circle (\R); %3D lighting effect \draw (O) circle (\R); \DrawLongitudeCircle[\R]{\angAz} % xzplane \DrawLongitudeCircle[\R]{\angAz + 90} % vzplane \DrawLatitudeCircle[\R]{0} % equator \DrawLatitudeCircle[\R]{70} % Latitude 70 \DrawLatitudeCircle[\R]{-70} % Latitude -70 \end{scope} % \coordinate[mark coordinate] (Sm) at (0, \H); \coordinate[mark coordinate] (Nm) at (0,-\H); \path[xzplane] (Nm) -- +(0,-0.75) coordinate (Nm1) node[below] {$\mathbf{N}_m$} (Sm) -- +(0,0.75) coordinate (Sm1) node[above] {$\mathbf{S}_m$}; \draw[very thick, dashed] (Sm) -- (Nm); \draw[very thick] (Sm1) -- (Sm); \draw[very thick,->,>=latex'](Nm) -- (Nm1); \end{scope} \node[align=justify, text width=14cm, anchor=north west] at (-7,-5.2) {Schematic Earth dipolar magnetic field. The field lines placed in the page plane are drawn as thick lines, those back with dashed lines and the field lines in front of the page with thin lines.}; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} %----------------------------------------------- % environment for drawing sticks % an option of the form scale=VALUE can be given %------------------------------------------------ \newenvironment{sticks}[1][scale=.6] {\begin{tikzpicture}[#1]\def\W{0}\def\WS{0}} {\end{tikzpicture}} %------------------------------------------------------------ % \stickME draws an empty multiplication stick %------------------------------------------------------------ \newcommand{\stickME}{% \begin{scope}[xshift=\W cm] \pgfmathparse{\W+2} \global\let\W\pgfmathresult \draw [black,rounded corners] (2,0) -- (2,24) -- (0,24) -- (0,0); \draw (0,0) -- (2,0); \foreach \x in {.5,1,...,22} { \draw (1.5,\x) -- (2,\x); } \draw (1.5,0) -- (1.5,22); \foreach \x in {4.5,8.5,12,15,17.5,19.5,21,22} { \draw (0,\x) -- (2,\x); } \end{scope} } %-------------------------------------------------------- % \stickDE draws an empty division stick %-------------------------------------------------------- \newcommand{\stickDE}{% \begin{scope}[xshift=\W cm] \pgfmathparse{\W+2} \global\let\W\pgfmathresult \draw [black,rounded corners] (2,0) -- (2,24) -- (0,24) -- (0,0); \draw (0,0) -- (2,0); \foreach \x in {.5,1,...,22} { \draw (0,\x) -- (.5,\x); } \draw (.5,0) -- (.5,22); \foreach \x in {4.5,8.5,12,15,17.5,19.5,21,22} { \draw (0,\x) -- (2,\x); } \end{scope} } %------------------------------------------------------------- % \drawX draws the special X stick %------------------------------------------------------------- \newcommand{\stickX}{% \stickME \begin{scope}[xshift=\WS cm] \pgfmathparse{\WS+2} \global\let\WS\pgfmathresult \node at (1,23) {X}; \pgfmathparse{21.75} \global\let\z\pgfmathresult \pgfmathparse{21.5} \global\let\w\pgfmathresult \foreach \x in {2,3,4,5,6,7,8,9} { \node at (.75,\w) {\x}; \pgfmathparse{\w-.75-.5*(\x-1)} \global\let\w\pgfmathresult \pgfmathparse{\x-1} \foreach \y in {0,...,\pgfmathresult} { \node[scale=.5] at (1.75,\z){\y}; \pgfmathparse{-0.5+\z} \global\let\z\pgfmathresult } } \end{scope} } %----------------------------------------------- % \stickR draws the special R stick %----------------------------------------------- \newcommand{\stickR}{% \stickDE \begin{scope}[xshift=\WS cm] \pgfmathparse{\WS+2} \global\let\WS\pgfmathresult \node at (1,23) {R}; \pgfmathparse{21.75} \global\let\z\pgfmathresult \pgfmathparse{21.5} \global\let\w\pgfmathresult \foreach \x in {2,3,4,5,6,7,8,9} { \node at (1.25,\w) {\x}; \pgfmathparse{\w-.75-.5*(\x-1)} \global\let\w\pgfmathresult \pgfmathparse{\x-1} \foreach \y in {0,...,\pgfmathresult} { \node[scale=.5] at (.25,\z){\y}; \pgfmathparse{-0.5+\z} \global\let\z\pgfmathresult } } \end{scope} } %------------------------------------------------------------------ % \stickM draws the stick of a multiplication table % #1 is the number of the table: value between 0 and 9 % #2 is the color of the triangles %------------------------------------------------------------------ \newcommand{\stickM}[2]{% \stickME \begin{scope}[xshift=\WS cm] \pgfmathparse{\WS+2} \global\let\WS\pgfmathresult \node at (1,23) {#1}; \pgfmathparse{21.75} \global\let\z\pgfmathresult \pgfmathparse{21.75} \global\let\w\pgfmathresult \foreach \x in {2,3,4,5,6,7,8,9} { \pgfmathparse{\x-1} \foreach \y in {0,...,\pgfmathresult} { \pgfmathmod{#1*\x+\y}{10} \pgfmathtruncatemacro\u\pgfmathresult \pgfmathtruncatemacro\d{(#1*\x+\y)/10} \node[scale=.5] at (1.75,\z){\u}; \pgfmathparse{\z+.25} \let\a\pgfmathresult \pgfmathparse{\w-.5*\d} \let\b\pgfmathresult \pgfmathparse{\z-.25} \let\c\pgfmathresult \draw[color=#2, fill=#2, thin] (0,\b) -- (1.5,\a) -- (1.5,\c) -- (0,\b); \pgfmathparse{-0.5+\z} \global\let\z\pgfmathresult } \pgfmathparse{\w-\x*.5} \global\let\w\pgfmathresult } \end{scope} } %------------------------------------------------------------ % \stickD draws the stick of a division table % #1 is the number of the table: value between 0 and 9 % #2 is the color of the lines %------------------------------------------------------------ \newcommand{\stickD}[2]{% \stickDE \begin{scope}[xshift=\WS cm] \pgfmathparse{\WS+2} \global\let\WS\pgfmathresult \node at (1,23) {#1}; \pgfmathparse{21.75} \global\let\z\pgfmathresult \pgfmathparse{21.75} \global\let\w\pgfmathresult \foreach \x in {2,3,4,5,6,7,8,9} { \pgfmathparse{\x-1} \foreach \y in {0,...,\pgfmathresult} { \pgfmathtruncatemacro\q{(#1+10*\y)/\x} \node[scale=.5] at (.25,\z){\q}; \pgfmathmod{#1+10*\y}{\x} \pgfmathparse{\w-.5*\pgfmathresult} \let\r\pgfmathresult \draw[color=#2] (.5,\z) -- (2,\r); \pgfmathparse{-0.5+\z} \global\let\z\pgfmathresult } \pgfmathparse{\w-\x*.5} \global\let\w\pgfmathresult } \end{scope} } \begin{document} \pagestyle{empty} % starting sticks environment \begin{sticks} % drawing the special X stick \stickX % drawing the muliplication tables sticks in red \stickM{0}{red} \stickM{1}{red} \stickM{2}{red} \stickM{3}{red} \stickM{4}{red} \stickM{5}{red} \stickM{6}{red} \stickM{7}{red} \stickM{8}{red} \stickM{9}{red} \end{sticks} % starting sticks environment \begin{sticks} % drawing the division tables sticks in red \stickD{0}{red} \stickD{1}{red} \stickD{2}{red} \stickD{3}{red} \stickD{4}{red} \stickD{5}{red} \stickD{6}{red} \stickD{7}{red} \stickD{8}{red} \stickD{9}{red} % drawing the special R stick \stickR \end{sticks} \end{document}
\documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage[upright]{fourier} \usepackage{tikz} \usetikzlibrary{matrix,arrows,decorations.pathmorphing} \usepackage{verbatim} \begin{document} % l' unite \newcommand{\myunit}{1 cm} \tikzset{ node style sp/.style={draw,circle,minimum size=\myunit}, node style ge/.style={circle,minimum size=\myunit}, arrow style mul/.style={draw,sloped,midway,fill=white}, arrow style plus/.style={midway,sloped,fill=white}, } \begin{tikzpicture}[>=latex] % les matrices \matrix (A) [matrix of math nodes, nodes = {node style ge}, left delimiter = (, right delimiter = )] at (0,0) { a_{11} & a_{12} & \ldots & a_{1p} \\ |[node style sp]| a_{21} & |[node style sp]| a_{22} & \ldots & |[node style sp]| a_{2p} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \ldots & a_{np} \\ }; \node [draw,below=10pt] at (A.south) { $A$ : \textcolor{red}{$n$ rows} $p$ columns}; \matrix (B) [matrix of math nodes, nodes = {node style ge}, left delimiter = (, right delimiter = )] at (6*\myunit,6*\myunit) { b_{11} & |[node style sp]| b_{12} & \ldots & b_{1q} \\ b_{21} & |[node style sp]| b_{22} & \ldots & b_{2q} \\ \vdots & \vdots & \ddots & \vdots \\ b_{p1} & |[node style sp]| b_{p2} & \ldots & b_{pq} \\ }; \node [draw,above=10pt] at (B.north) { $B$ : $p$ rows \textcolor{red}{$q$ columns}}; % matrice résultat \matrix (C) [matrix of math nodes, nodes = {node style ge}, left delimiter = (, right delimiter = )] at (6*\myunit,0) { c_{11} & c_{12} & \ldots & c_{1q} \\ c_{21} & |[node style sp,red]| c_{22} & \ldots & c_{2q} \\ \vdots & \vdots & \ddots & \vdots \\ c_{n1} & c_{n2} & \ldots & c_{nq} \\ }; % les fleches \draw[blue] (A-2-1.north) -- (C-2-2.north); \draw[blue] (A-2-1.south) -- (C-2-2.south); \draw[blue] (B-1-2.west) -- (C-2-2.west); \draw[blue] (B-1-2.east) -- (C-2-2.east); \draw[<->,red](A-2-1) to[in=180,out=90] node[arrow style mul] (x) {$a_{21}\times b_{12}$} (B-1-2); \draw[<->,red](A-2-2) to[in=180,out=90] node[arrow style mul] (y) {$a_{22}\times b_{22}$} (B-2-2); \draw[<->,red](A-2-4) to[in=180,out=90] node[arrow style mul] (z) {$a_{2p}\times b_{p2}$} (B-4-2); \draw[red,->] (x) to node[arrow style plus] {$+$} (y)% to node[arrow style plus] {$+\raisebox{.5ex}{\ldots}+$} (z) to (C-2-2.north west); \node [draw,below=10pt] at (C.south) {$ C=A\times B$ : \textcolor{red}{$n$ rows} \textcolor{red}{$q$ columns}}; \end{tikzpicture} \begin{tikzpicture}[>=latex] % unit % defintion of matrices \matrix (A) [matrix of math nodes,% nodes = {node style ge},% left delimiter = (,% right delimiter = )] at (0,0) {% a_{11} &\ldots & a_{1k} & \ldots & a_{1p} \\ \vdots & \ddots & \vdots & \vdots & \vdots \\ |[node style sp]| a_{i1} & \ldots% & |[node style sp]| a_{ik}% & \ldots% & |[node style sp]| a_{ip} \\ \vdots & \vdots& \vdots & \ddots & \vdots \\ a_{n1}& \ldots & a_{nk} & \ldots & a_{np} \\ }; \node [draw,below] at (A.south) { $A$ : \textcolor{red}{$n$ rows} $p$ columns}; \matrix (B) [matrix of math nodes,% nodes = {node style ge},% left delimiter = (,% right delimiter =)] at (7*\myunit,7*\myunit) {% b_{11} & \ldots& |[node style sp]| b_{1j}% & \ldots & b_{1q} \\ \vdots& \ddots & \vdots & \vdots & \vdots \\ b_{k1} & \ldots& |[node style sp]| b_{kj}% & \ldots & b_{kq} \\ \vdots& \vdots & \vdots & \ddots & \vdots \\ b_{p1} & \ldots& |[node style sp]| b_{pj}% & \ldots & b_{pq} \\ }; \node [draw,above] at (B.north) { $B$ : $p$ rows \textcolor{red}{$q$ columns}}; % matrice resultat \matrix (C) [matrix of math nodes,% nodes = {node style ge},% left delimiter = (,% right delimiter = )] at (7*\myunit,0) {% c_{11} & \ldots& c_{1j} & \ldots & c_{1q} \\ \vdots& \ddots & \vdots & \vdots & \vdots \\ c_{i1}& \ldots & |[node style sp,red]| c_{ij}% & \ldots & c_{iq} \\ \vdots& \vdots & \vdots & \ddots & \vdots \\ c_{n1}& \ldots & c_{nk} & \ldots & c_{nq} \\ }; \node [draw,below] at (C.south) {$ C=A\times B$ : \textcolor{red}{$n$ rows} \textcolor{red}{$q$ columns}}; % arrows \draw[blue] (A-3-1.north) -- (C-3-3.north); \draw[blue] (A-3-1.south) -- (C-3-3.south); \draw[blue] (B-1-3.west) -- (C-3-3.west); \draw[blue] (B-1-3.east) -- (C-3-3.east); \draw[<->,red](A-3-1) to[in=180,out=90] node[arrow style mul] (x) {$a_{i1}\times b_{1j}$} (B-1-3); \draw[<->,red](A-3-3) to[in=180,out=90] node[arrow style mul] (y) {$a_{ik}\times b_{kj}$}(B-3-3); \draw[<->,red](A-3-5) to[in=180,out=90] node[arrow style mul] (z) {$a_{ip}\times b_{pj}$}(B-5-3); \draw[red,->] (x) to node[arrow style plus] {$+\raisebox{.5ex}{\ldots}+$} (y) to node[arrow style plus] {$+\raisebox{.5ex}{\ldots}+$} (z); % % to (C-3-3.north west); \draw[->,red,decorate,decoration=zigzag] (z) -- (C-3-3.north west); \end{tikzpicture} \end{document} % encoding : utf8 % format : pdfLaTeX % author : Alain Matthes
\documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{trees} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.markings} \usetikzlibrary{decorations.pathreplacing,decorations.pathmorphing} \begin{document} %\pagestyle{empty} \begin{figure}[t!] \begin{tikzpicture}[scale=.55,interface/.style={ postaction={draw,decorate,decoration={border,angle=45, amplitude=0.5cm,segment length=3mm}}}] \begin{scope}[xshift=-100mm, yshift=90,every node/.append style={ yslant=0.5,xslant=-1},yslant=0.5,xslant=-1 ] %\fill[white,fill opacity=.9] (0,0) rectangle (7,9); %Coarse grid is obtained by drawins subgridS and puzzling them together. \draw[step=20mm,black,ultra thick,dashed] (2,0) grid (6,9); \draw[step=20mm,black,ultra thick,dashed] (6,5) grid (9,9); %interface \draw[line width=.8pt,interface,very thick,black](-5.2,-3)--(-5.2,9); %nested grid \draw[step=4mm, red] (-5.2,.2) grid (1.8,5); \draw[step=4mm, thick,red,dotted] (-6.8,.2) grid (-5.2,5); \draw[black,ultra thick] (-5.2,.2) rectangle (1.8,5); \draw[step=20mm,black,ultra thick,dashed] (-5.2,-.2) grid (2,-3.1);%XXXXXX \draw[step=20mm,black,ultra thick,dashed] (-5.2,5.2) grid (1.8,8); %filling \fill[yellow,ultra thick] (1.82,0) rectangle (1.98,5);%boundary area \fill[yellow,ultra thick] (-5.2,5) rectangle (1.8,5.2);%boundary area \fill[yellow,ultra thick] (-5.2,.2) rectangle (2,0);%boundary area \fill[red,ultra thick] (6.1,6.1) rectangle (7.9,7.9);%cell element % %axes % \draw[->,very thick,black](-3,-5) to[](-2,-5); % \draw[->,very thick,black](-3,-5) to[](-3,-4); %\draw[-,ultra thin,black,dashed](-4.5,-5) to[](-4.5,6); \draw[<-,ultra thick,black,red](3.5,1) to[](4.5,1); \draw[<-,ultra thick,black,red](3.5,3) to[](4.5,3); \draw[<-,ultra thick,black,red](3.5,5) to[](4.5,5); \draw[<-,ultra thick,black,red](2,1) to[](2.5,1); \draw[<-,ultra thick,black,red](2,3) to[](2.5,3); \draw[<-,ultra thick,black,red](2,5) to[](2.5,5); %arrows interacting with yellow boundary zone \draw[<-,ultra thick,black,red](5.5,1) to[](6.5,1); \draw[<-,ultra thick,black,red](5.5,3) to[](6.5,3); \draw[<-,ultra thick,black,red](5.5,5) to[](6.5,5); %Inside the grid % \foreach \t in {-80,-60,...,80} { \DrawLatitudeCircle[\R]{\t} } %\foreach \y in {0.5,1,...,3} { \draw[<-](1,{\y}) to[](1.5,{\y})}; \draw[<-,ultra thick,blue](-5,1.5) to[](-4.5,1.5); \draw[<-,ultra thick,blue](-5,2.5) to[](-4.5,2.5); \draw[<-,ultra thick,blue](-5,3.5) to[](-4.5,3.5); \draw[<-,ultra thick,blue](-5,4.5) to[](-4.5,4.5); \draw[<-,thick,blue](-4,1) to[](-3.5,1); \draw[<-,thick,blue](-4,2) to[](-3.5,2); \draw[<-,thick,blue](-4,3) to[](-3.5,3); \draw[<-,thick,blue](-4,4) to[](-3.5,4); \draw[<-,thick,blue](-3,1.5) to[](-2.5,1.5); \draw[<-,thick,blue](-3,2.5) to[](-2.5,2.5); \draw[<-,thick,blue](-3,3.5) to[](-2.5,3.5); \draw[<-,thick,blue](-3,4.5) to[](-2.5,4.5); \draw[<-,thick,blue](-2,1.3) to[](-1.5,1.5); \draw[<-,thick,blue](-2,2.3) to[](-1.5,2.5); \draw[<-,thick,blue](-2,3.3) to[](-1.5,3.5); \draw[<-,thick,blue](-2,4.3) to[](-1.5,4.5); \draw[<-,thick,blue](-1,1.3) to[](-.5,1); \draw[<-,thick,blue](-1,2.3) to[](-.5,2); \draw[<-,thick,blue](-1,3.3) to[](-.5,3); \draw[<-,thick,blue](-1,4.3) to[](-.5,4); \draw[<-,thick,blue](0,1.3) to[](.5,1.5); \draw[<-,thick,blue](0,2.3) to[](.5,2.5); \draw[<-,thick,blue](0,3.3) to[](.5,3.5); \draw[<-,thick,blue](0,4.3) to[](.5,4.5); \draw[<-,thick,blue](1,1.3) to[](1.5,1); \draw[<-,thick,blue](1,2.3) to[](1.5,2); \draw[<-,thick,blue](1,3.3) to[](1.5,3); \draw[<-,thick,blue](1,4.3) to[](1.5,4); %\draw[<-,thick,blue](-4,5) to[](-3.5,5); % \draw[<-,ultra thick,black,green](1,3) to[](1.5,3); %WAM or WAVEWATCH forcing \draw[-,ultra thick,dashed, black] (-5.2,9) to[] (-5.2,10); \draw[-,ultra thick,dashed, black] (-5.2,9.5) to[] (-5.2,10.5); \draw[-,step=20mm,ultra thick,dashed, orange] (-5.2,10.5) grid (13,12); \fill[yellow] (-5.2,11.8) rectangle (13,12); \draw[<-,ultra thick,green,dotted](1.5,12) to[](1.5,13); \draw[<-,ultra thick,green](3.5,12) to[](3.5,13); \draw[<-,ultra thick,green,dotted](5.5,12) to[](5.5,13); \draw[<-,ultra thick,green](7.5,12) to[](7.5,13); \draw[<-,thick,red](1.5,11) to[](1.5,12); \draw[<-,thick,red](3.5,11) to[](3.5,12); \draw[<-,thick,red](5.5,11) to[](5.5,12); \draw[<-,thick,red](7.5,11) to[](7.5,12); \draw[<-,thick,red](9.5,11) to[](9.5,12); %pointers \draw[thick](-8,9)node[below]{$\mathsf{Land}$}; \draw[thick](-3,10)node[below]{$\mathsf{Water}$}; \draw[thick,red](13,10)node[below]{$\mathsf{Inside\ Grid}$}; \draw[thick,green](12,15)node[below]{$\mathsf{Outside\ Grid\ (WAM)}$}; \draw[thick,red](13,9)node[below]{$\mathsf{(SWAN)}$}; \end{scope} \end{tikzpicture} \caption[Nested Grids in SWAN and WAM coupling]{SWAN nested (finer resolution) grid represented in red and computational grid (coarser) in black. On the former occours bla bla bla; grid covers land wich is assumed to totally absorb incoming spectral flux \textit{killing} back-propagation. On the latter bla bla bla. Boundary zone between grids drawn in yellow: note how incoming signal (outside yellow rectangle) duplicates or triplicates \textit{once crossed} boundary (inside yellow rectangle) for both cases. Same principle holds for nesting with WAM whose incoming signal (green) has lower spatial resolution, which is improved once passed \textit{trough} the yellow interface. Note how resolution tend to increasem by approaching shallow waters. WAM/SWAN interface drawn in orange. Cell grid (red filled box), represented in Fig.(??)} \label{fig:nesting} \end{figure} \end{document}
\documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[x={(0.866cm,-0.5cm)}, y={(0.866cm,0.5cm)}, z={(0cm,1cm)}, scale=1.0, %Option for nice arrows >=stealth, % inner sep=0pt, outer sep=2pt,% axis/.style={thick,->}, wave/.style={thick,color=#1,smooth}, polaroid/.style={fill=black!60!white, opacity=0.3}, ] % Colors \colorlet{darkgreen}{green!50!black} \colorlet{lightgreen}{green!80!black} \colorlet{darkred}{red!50!black} \colorlet{lightred}{red!80!black} % Frame \coordinate (O) at (0, 0, 0); \draw[axis] (O) -- +(14, 0, 0) node [right] {x}; \draw[axis] (O) -- +(0, 2.5, 0) node [right] {y}; \draw[axis] (O) -- +(0, 0, 2) node [above] {z}; \draw[thick,dashed] (-2,0,0) -- (O); % monochromatic incident light with electric field \draw[wave=blue, opacity=0.7, variable=\x, samples at={-2,-1.75,...,0}] plot (\x, { cos(1.0*\x r)*sin(2.0*\x r)}, { sin(1.0*\x r)*sin(2.0*\x r)}) plot (\x, {-cos(1.0*\x r)*sin(2.0*\x r)}, {-sin(1.0*\x r)*sin(2.0*\x r)}); \foreach \x in{-2,-1.75,...,0}{ \draw[color=blue, opacity=0.7,->] (\x,0,0) -- (\x, { cos(1.0*\x r)*sin(2.0*\x r)}, { sin(1.0*\x r)*sin(2.0*\x r)}) (\x,0,0) -- (\x, {-cos(1.0*\x r)*sin(2.0*\x r)}, {-sin(1.0*\x r)*sin(2.0*\x r)}); } \filldraw[polaroid] (0,-2,-1.5) -- (0,-2,1.5) -- (0,2,1.5) -- (0,2,-1.5) -- (0,-2,-1.5) node[below, sloped, near end]{Polaroid};% %Direction of polarization \draw[thick,<->] (0,-1.75,-1) -- (0,-0.75,-1); % Electric field vectors \draw[wave=blue, variable=\x,samples at={0,0.25,...,6}] plot (\x,{sin(2*\x r)},0)node[anchor=north]{$\vec{E}$}; %Polarized light between polaroid and thin section \foreach \x in{0, 0.25,...,6} \draw[color=blue,->] (\x,0,0) -- (\x,{sin(2*\x r)},0); \draw (3,1,1) node [text width=2.5cm, text centered]{Polarized light}; %Crystal thin section \begin{scope}[thick] \draw (6,-2,-1.5) -- (6,-2,1.5) node [above, sloped, midway]{Crystal section} -- (6, 2, 1.5) -- (6, 2, -1.5) -- cycle % First face (6, -2, -1.5) -- (6.2, -2,-1.5) (6, 2, -1.5) -- (6.2, 2,-1.5) (6, -2, 1.5) -- (6.2, -2, 1.5) (6, 2, 1.5) -- (6.2, 2, 1.5) (6.2,-2, -1.5) -- (6.2, -2, 1.5) -- (6.2, 2, 1.5) -- (6.2, 2, -1.5) -- cycle; % Second face %Optical indices \draw[darkred, ->] (6.1, 0, 0) -- (6.1, 0.26, 0.966) node [right] {$n_{g}'$}; % index 1 \draw[darkred, dashed] (6.1, 0, 0) -- (6.1,-0.26, -0.966); % index 1 \draw[darkgreen, ->] (6.1, 0, 0) -- (6.1, 0.644,-0.173) node [right] {$n_{p}'$}; % index 2 \draw[darkgreen, dashed] (6.1, 0, 0) -- (6.1,-0.644, 0.173); % index 2 \end{scope} %Rays leaving thin section \draw[wave=darkred, variable=\x, samples at={6.2,6.45,...,12}] plot (\x, {0.26*0.26*sin(2*(\x-0.5) r)}, {0.966*0.26*sin(2*(\x-0.5) r)}); %n'g-oriented ray \draw[wave=darkgreen, variable=\x, samples at={6.2,6.45,...,12}] plot (\x, {0.966*0.966*sin(2*(\x-0.1) r)},{-0.26*0.966*sin(2*(\x-0.1) r)}); %n'p-oriented ray \draw (10,1,1) node [text width=2.5cm, text centered] {Polarized and dephased light}; \foreach \x in{6.2,6.45,...,12} { \draw[color=darkgreen, ->] (\x, 0, 0) -- (\x, {0.966*0.966*sin(2*(\x-0.1) r)}, {-0.26*0.966*sin(2*(\x-0.1) r)}); \draw[color=darkred, ->] (\x, 0, 0) -- (\x, {0.26*0.26*sin(2*(\x-0.5) r)}, {0.966*0.26*sin(2*(\x-0.5) r)}); } %Second polarization \draw[polaroid] (12, -2, -1.5) -- (12, -2, 1.5) %Polarizing filter node [above, sloped,midway] {Polaroid} -- (12, 2, 1.5) -- (12, 2, -1.5) -- cycle; \draw[thick, <->] (12, -1.5,-0.5) -- (12, -1.5, 0.5); %Polarization direction %Light leaving the second polaroid \draw[wave=lightgreen,variable=\x, samples at={12, 12.25,..., 14}] plot (\x,{0}, {0.966*0.966*0.26*sin(2*(\x-0.5) r)}); %n'g polarized ray \draw[wave=lightred, variable=\x, samples at={12, 12.25,..., 14}] plot (\x,{0}, {-0.26*0.966*sin(2*(\x-0.1) r)}); %n'p polarized ray \node[align=justify, text width=14cm, anchor=north west, yshift=-2mm] at (current bounding box.south west) {Light behavior in a petrographic microscope with light polarizing device. Only one incident wavelength is shown (monochromatic light). The magnetic field, perpendicular to the electric one, is not drawn.}; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage[margin=0.3cm, paperwidth=9.5cm, paperheight=9.5cm]{geometry} \usepackage{tikz} \usetikzlibrary{fadings} \definecolor{darkgreen}{rgb}{0.2,0.6,0.2} \definecolor{poppyred}{rgb}{0.89,0.08,0.3} \definecolor{poppyredd}{rgb}{0.78,0.0,0.09} \definecolor{poppyreddd}{rgb}{0.63,0.0,0.0} \def\petala{ [rounded corners=3] (0,0) % .. controls (-0.25,-0.5) and (-1.25,0.3) .. (-1.6,0) % .. controls (-1.6,0.75) and (-1.25,0.65) .. (-1.1,1) % .. controls (-1.05,0.65) and (-0.05,0.7) .. (0,0)} \def\petalb{ [rounded corners=3] (0,0)% .. controls (-0.55,-0.2) and (-1.25,0.7) .. (-1.5,0.6)% .. controls (-1.4,1.1) and (-1.15,0.9) .. (-0.75,1.4)% .. controls (-0.5,1.5) and (-0.05,1.45) .. (0.05,1.3)% .. controls (-0.15,1.1) and (0.25,0.05) .. (0,0)} \def\petalc{[rotate=-30] \petalb} \def\petald{[rotate=-90] \petala} \def\petiolea{ [rounded corners=2] (0.25,-7) % .. controls (0.7,-5.5) and (0.3,-3) .. (0.25,-2) % .. controls (0.2,-1.5) and (0.33,-0.4) .. (0,0) % .. controls (0.34,-0.4) and (0.21,-1.5) .. (0.27,-2) % .. controls (0.4,-3) and (0.82,-5.5) .. (0.42,-7) } \def\petioleb{ [rounded corners=2] (0.1,-7) % .. controls (0.3,-3) and (-0.85,-1.05) .. (-2.3,-1) % arc (270:230:0.2)% .. controls (-2.7,-1) and (-3.05,-1.05) .. (-3.35,-1.3) % .. controls (-3.35,-1.5) and (-3.45,-1.75) .. (-3.65,-1.75) % .. controls (-3.7,-1.25) and (-3.4,-1.35) .. (-3.4,-1.25) % .. controls (-3.05,-0.95) and (-2.7,-0.9) .. (-2.4,-0.85) % .. controls (-1.1,-0.75) and (0.4,-2.45) .. (0.2,-7) } \def\petiolec{ [rounded corners=2] (-0.3,-7) % .. controls (-0.9,-3.5) and (-1.5,-2.7) .. (-2,-2.5) % .. controls (-2.5,-2.3) and (-3.2,-2.35) .. (-3.47,-3.5) % .. controls (-3.68,-3.85) and (-3.75,-4.2) .. (-3.9,-4.15) % .. controls (-4.0,-3.9) and (-3.8,-3.8) .. (-3.7,-3.8) % .. controls (-3.65,-3.75) and (-3.6,-3.7) .. (-3.5,-3.47) % .. controls (-3.2,-2.3) and (-2.5,-2.25) .. (-2,-2.45) % .. controls (-1.48,-2.65) and (-0.86,-3.5) .. (-0.26,-7) } \tikzfading[name=fade inside, inner color=transparent!100, outer color=transparent!30] \tikzfading[name=fade out, inner color=transparent!0, outer color=transparent!100] %%%------beautiful flower------%%% \def\flower{ % draw each petal independently \foreach \a in {\petala,\petalb,\petalc,\petald} { \filldraw[draw=none,color=poppyred,opacity=0.8] [postaction={path fading=south,fading angle=30,fill=poppyreddd,opacity=.2}] \a; } % draw all petals together \draw[draw=none,rounded corners=3] [postaction={path fading=north,fading angle=30,fill=poppyreddd,opacity=.7}] \petala \petalb \petalc [rotate=30] \petald; % emphasise overlapping areas between two petals \begin{scope} \foreach \a/\b in {\petala/\petalb,\petalb/\petalc,\petalc/\petald} { \begin{scope} \clip \a; \draw [draw=none] [postaction={path fading=fade inside,fill=poppyredd,opacity=.7}] \b; \end{scope} } \end{scope} % emphasise overlapping areas between three petals \begin{scope} \foreach \a/\b/\c in {\petala/\petalb/\petalc,\petalb/\petalc/\petald} { \begin{scope} \clip \a; \clip \b; \draw [draw=none] [postaction={path fading=fade out,fill=poppyreddd,opacity=.4}] \c; \end{scope} } \end{scope} } \def\petioles[#1]{ \foreach \a in {\petiolea,\petioleb,\petiolec} { \draw[fill,color=#1] \a; } } %%% -----------POPPIES---------------- %%% % beautiful poppy \def\poppy[#1,#2]{ \begin{scope}[shift={#1},scale=#2] % draw the flower \flower; % draw petioles \petioles[darkgreen] \end{scope} } % poppy with uniform color \def\poppyu[#1,#2]{ \begin{scope}[shift={#1},scale=#2] % draw the flower \foreach \a in {\petala,\petalb,\petalc,\petald} { \filldraw[draw=none,color=poppyred,opacity=0.8] \a; } % draw petioles \petioles[darkgreen] \end{scope} } % black and white poppy \def\poppybw[#1,#2]{ \begin{scope}[shift={#1},scale=#2] % draw the flower \foreach \a in {\petala,\petalb,\petalc,\petald} { \filldraw[draw=none,color=gray!80,opacity=1] \a; } % draw petioles \petioles[gray!80] \end{scope} } \begin{document} \thispagestyle{empty} \begin{center} \tikz\poppy[{(0cm,0cm)},1]; \tikz\poppyu[{(4cm,0cm)},1]; \tikz\poppybw[{(7cm,0cm)},0.8]; \end{center} \end{document}
\documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{decorations.markings} \tikzset {every pin/.style = {pin edge = {<-}}, % pins are arrows from label to point > = stealth, % arrow tips look like stealth bombers flow/.style = % everything marked as "flow" will be decorated with an arrow {decoration = {markings, mark=at position #1 with {\arrow{>}}}, postaction = {decorate} }, flow/.default = 0.5, % default position of the arrow is in the middle main/.style = {line width=1pt} % thick lines for main graph } % \newtemplate[Scaling, default 0.18]{\NameOfTemplate}{Caption}{Code} % % Typesets Code and stores it in the box \NameOfTemplate. % This way we avoid nested tikzpictures when inserting the templates into the % main picture, since nesting is not guaranteed to work. \newcommand\newtemplate[4][0.18]% {\newsavebox#2% \savebox#2% {\begin{tabular}{@{}c@{}} \begin{tikzpicture}[scale=#1] #4 \end{tikzpicture}\\[-1ex] \templatecaption{#3}\\[-1ex] \end{tabular}% }% } \newcommand\template[1]{\usebox{#1}} % use the Code stored in box #1 \newcommand\templatecaption[1]{{\sffamily\scriptsize#1}} % typeset caption \newcommand\Tr{\mathop{\mathrm{Tr}}} \newtemplate\sink{sink}% {\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (\sx4,0) -- (0,0); % draw half of horizontal axis \draw[flow] (0,\sx4) -- (0,0); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b in {2/1,3/0.44} % draw two half-parabolas \draw[flow,domain=\sx\a:0] plot (\x, {\sy\b*\x*\x}); } } \newtemplate\source{source}% {\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (0,0) -- (\sx4,0); % draw half of horizontal axis \draw[flow] (0,0) -- (0,\sx4); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b in {2/1,3/0.44} % draw two half-parabolas \draw[flow,domain=0:\sx\a] plot (\x, {\sy\b*\x*\x}); } } \newtemplate\stablefp{line of stable fixed points}% {\draw (-4,0) -- (4,0); % draw horizontal axis \foreach \sy in {+,-} % for upper/lower half do: {\draw[flow] (0,\sy4) -- (0,0); % draw half of vertical axis \foreach \x in {-3,-2,-1,1,2,3} % draw six vertical half-lines \draw[flow] (\x,\sy3) -- (\x,0); } } \newtemplate\unstablefp{line of unstable fixed points}% {\draw (-4,0) -- (4,0); % draw horizontal axis \foreach \sy in {+,-} % for upper/lower half do: {\draw[flow] (0,0) -- (0,\sy4); % draw half of vertical axis \foreach \x in {-3,-2,-1,1,2,3} % draw six vertical half-lines \draw[flow] (\x,0) -- (\x,\sy3); } } \newtemplate\spiralsink{spiral sink}% {\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \draw [samples=100,smooth,domain=27:7] % draw spiral plot ({\x r}:{0.005*\x*\x}); % Using "flow" here gives "Dimension \def\x{26} % too large", so we draw a tiny \draw[->] ({\x r}:{0.005*\x*\x}) -- +(0.01,-0.01);% tangent for the arrow. } \newtemplate\spiralsource{spiral source}% {\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \draw [samples=100,smooth,domain=10:28] % draw spiral plot ({-\x r}:{0.005*\x*\x}); % Using "flow" here gives "Dimension \def\x{27.5} % too large", so we draw a tiny \draw[<-] ({-\x r}:{0.005*\x*\x}) -- +(0.01,-0.008);% tangent for the arrow. } \newtemplate[0.15]\centre{center}% British spelling since \center is in use {\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \foreach \r in {1,2,3} % draw three circles \draw[flow=0.63] (\r,0) arc (0:-360:\r cm); } \newtemplate\saddle{saddle}% {\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (\sx4,0) -- (0,0); % draw half of horizontal axis \draw[flow] (0,0) -- (0,\sx4); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b/\c/\d in {2.8/0.3/0.7/0.6, 3.9/0.4/1.3/1.1} \draw[flow] (\sx\a,\sy\b) % draw two bent lines .. controls (\sx\c,\sy\d) and (\sx\d,\sy\c) .. (\sx\b,\sy\a); } } \newtemplate\degensink{degenerate sink}% {\draw (0,-4) -- (0,4); % draw vertical axis \foreach \s in {+,-} % for upper/lower half do: {\draw[flow] (\s4,0) -- (0,0); % draw half of horizontal axis \foreach \a/\b/\c/\d in {3.5/4/1.5/1, 2.5/2/1/0.8} \draw[flow] (\s-3.5,\s\a) % draw two bent lines .. controls (\s\b,\s\c) and (\s\b,\s\d) .. (0,0); } } \newtemplate\degensource{degenerate source}% {\draw (0,-4) -- (0,4); % draw vertical axis \foreach \s in {+,-} % for upper/lower half do: {\draw[flow] (0,0) -- (\s4,0); % draw half of horizontal axis \foreach \a/\b/\c/\d in {3.5/4/1.5/1, 2.5/2/1/0.8} \draw[flow] (0,0) % draw two bent lines .. controls (\s\b,\s\d) and (\s\b,\s\c) .. (\s-3.5,\s\a); } } \begin{document} \begin{tikzpicture}[line cap=round,line join=round] % MAIN DIAGRAM \draw [main,->] (0,-0.3) -- (0,4.7) % vertical axis node [label={[above]$\scriptstyle\det A$}] {} node [label={[above,yshift=0.8cm]% {\sffamily\large Poincar\'e Diagram: Classification of Phase Portraits in the $(\det A,\Tr A)$-plane}}] {}; \draw [main,->] (-5,0) -- (5,0) % horizontal axis node [label={[right,yshift=-0.5ex]$\scriptstyle\Tr A$}] {}; \draw [main, domain=-4:4] plot (\x, {0.25*\x*\x}); % main graph \node at (-4,4) [pin={[above]$\scriptstyle\Delta=0$}] {}; \node at ( 4,4) [pin={[above,align=left]% {$\scriptstyle\Delta=0:\;\det A=\frac{1}{4}(\Tr A)^2$}}] {}; % TEMPLATES describing areas \node at ( 0 ,-1.4) {\template\saddle}; \node at (-4 , 1 ) {\template\sink}; \node at ( 4 , 1 ) {\template\source}; \node at (-1.8, 3.7) {\template\spiralsink}; \node at ( 1.8, 3.7) {\template\spiralsource}; % TEMPLATES labeling lines and points \node at ( 0 , 1.2) [pin={[draw,right,xshift=0.3cm]% \template\centre}] {}; \node at (-3 , 0 ) [pin={[draw,below,yshift=-1cm]% \template\stablefp}] {}; \node at ( 3 , 0 ) [pin={[draw,below,yshift=-1cm]% \template\unstablefp}] {}; \node at (-3.5,{0.25*3.5*3.5}) [pin={[draw,left,xshift=-1.15cm,yshift=-0.3cm]% \template\degensink}] {}; \node at ( 3.5,{0.25*3.5*3.5}) [pin={[draw,right,xshift=0.9cm,yshift=-0.3cm]% \template\degensource}] {}; \node at ( 0 , 0 ) [pin={[draw,above left,align=center,xshift=-0.3cm]% \templatecaption{uniform}\\[-1ex]\templatecaption{motion}}] {}; \end{tikzpicture} \end{document}
\documentclass[landscape]{article} \usepackage{siunitx} \usepackage[american,cuteinductors,smartlabels]{circuitikz} \usetikzlibrary{calc} \ctikzset{bipoles/thickness=1} \ctikzset{bipoles/length=0.8cm} \ctikzset{bipoles/diode/height=.375} \ctikzset{bipoles/diode/width=.3} \ctikzset{tripoles/thyristor/height=.8} \ctikzset{tripoles/thyristor/width=1} \ctikzset{bipoles/vsourceam/height/.initial=.7} \ctikzset{bipoles/vsourceam/width/.initial=.7} \tikzstyle{every node}=[font=\small] \tikzstyle{every path}=[line width=0.8pt,line cap=round,line join=round] \begin{document} \begin{center} \begin{circuitikz} \draw (0,0) to[V, l=$V_s$] ++(0,2.5) to[short] ++(1,0) coordinate (A) to[short] ++(0.5,0) to[L, l^=$L_1$, v=$v_{L_1}$] ++(1.5,0) to[short] ++(1,0) coordinate (B) to[short] ++(1,0) node[above] (C) {1} to[open, o-o] ++(0.65,0) coordinate (D) to[short] ++(0.5,0) to[L, l^=$L_2$, v=$v_{L_2}$] ++(1.5,0) to[short] ++(0.5,0) coordinate (E) to[short] ++(1.5,0) to[generic, v^=$~~V_o$] ++(0,-2.5) --(0,0) (A) % Left of L1, top of switch A to[short] ++(0,-1.5) node[left] {2} to[open, o-o] ++(0,-0.5) node[left] {1} |- (0,0) (B) % C1 connection starting from top to[C, l=$C_1$] ++(0,-1.75) coordinate (Aaux) -- ($(A |- Aaux) + (0.5,0)$) to[short, o-] ++(-0.5,-0.15) ($(C)!0.5!(D)$) % Switch B low connector ++(0,-0.5) node[left] {2} to[short, o-] ++(0,-0.1) |- (0,0) (D) % Switch B blade to[short] ++(-0.65, -0.1) (E) % C2 connection to[C, l=$C_2$] ++(0,-2.5) (B) % Vc1 to[open, v=$V_{C_1}~~$] (Aaux) ; \end{circuitikz} \bigskip \begin{circuitikz} \draw (0,0) to[V, l=$V_s$] ++(0,2) to[short] ++(0.5,0) to[L, l^=$L_x$] ++(1.5,0) to[short] ++(0.5,0) coordinate (Qpos) to[C, l^=$C_1$] ++(2.5,0) coordinate (LMpos) to[L, l_=$L_m$] ++(0,-2) (LMpos) to[short] ++(0.7,0) coordinate(N1) to[L] ++(0,-2) to[short] (0,0) (Qpos)++(0,-2) to[Tnigbt] ++(0,2) % ------------------------ Secondary side (N1)++(0.7,0) coordinate (N2) to[D*] ++(2.5,0) coordinate (C2pos) to[C, l_=$C_2$] ++(0,-2) (C2pos) to[short] ++(1.5,0) to[R, l_=$R$] ++(0,-2) to[short] ($(N2)+(0,-2)$) to[L] (N2) (C2pos)++(2,0) to[open, v^<=$v_o(t)$] ++(0,-2) % ------------------------ Transformer lines ($(N1)!0.5!(N2)$)++(-0.05,-0.5) -- ++(0,-1) ++(0.1,0) -- ++(0,1) ($(N1)!0.5!(N2)$)++(0,0.3) node {$N_1:N_2$} ($(N1)+(-0.15,-0.5)$) node[circ] {} ($(N2)+(+0.15,-0.5)$) node[circ] {} ; \end{circuitikz} \bigskip \begin{tikzpicture} \draw % DC sources (0,0) to[battery, l=\SI{60}{\volt}] ++(0,4) coordinate (Vcc) ++(2,0) coordinate (NE) % Switches and diodes for leg a ++(0,-1) node [nigbt,scale=0.8,name=igbt1] {} ++(0,-2) node [nigbt,scale=0.8,name=igbt4] {} (igbt1.E)++(0,0.1) -- ++(0.3,0) to[D*] ($(igbt1.C)+(0.3,-0.1)$) -- ++(-0.3,0) (igbt4.E)++(0,0.1) -- ++(0.3,0) to[D*] ($(igbt4.C)+(0.3,-0.1)$) -- ++(-0.3,0) % --Switch connections for leg a (Vcc) -| (igbt1.C) (igbt1.E) -- (igbt4.C) (igbt4.E) |- (0,0) % Switches and diodes for leg b (NE)++(3,0) ++(0,-1) node [nigbt,scale=0.8,name=igbt3] {} ++(0,-2) node [nigbt,scale=0.8,name=igbt2] {} (igbt3.E)++(0,0.1) -- ++(0.3,0) to[D*] ($(igbt3.C)+(0.3,-0.1)$) -- ++(-0.3,0) (igbt2.E)++(0,0.1) -- ++(0.3,0) to[D*] ($(igbt2.C)+(0.3,-0.1)$) -- ++(-0.3,0) % --Switch connections for leg b (Vcc) -| (igbt3.C) (igbt3.E) -- (igbt2.C) (igbt2.E) |- (0,0) % Inductor, grid, and the return path (2,2.2) to[short, *-, i=$i_o(t)$, current/distance=0.9] ++(6,0) to[L, l=\SI{100}{\milli\henry}] ++(1.2,0) to[R] ++(1.2,0) coordinate (Lright) to[short] ++(1,0) ++(0,-2) to[V, l=$\sqrt{2}\cdot 230 \cos(314t)$, mirror] ++(0,2) ++(0,-2) to[short] ++(-5,0) |- (5,1.8) node[circ] {} % P and arrow (Lright)++(0.2,0) to[open, o-o] ++(0,-2) (Lright)++(0.2,-1) node [text width=2pt] {$\Rightarrow P$} % v_o(t) (6.5,2.2) to[open, v^=$v_o(t)$] ++(0,-2) ; \end{tikzpicture} \end{center} \end{document}
\documentclass{article} \usepackage[margin=0.3cm, paperwidth=8.4cm, paperheight=8.4cm]{geometry} \usepackage{tikz} \usetikzlibrary{shadows} \usetikzlibrary{fadings} \tikzfading[name=fade out, inner color=transparent!0, outer color=transparent!100] \def\petal { [rounded corners=0.5] % (-1,0)% .. controls (-1,0.6) and (-0.07,0.8).. (0,1)% .. controls (0.07,0.8) and (1,0.6).. (1,0)% .. controls (0.7,-1) and (-0.7,-1).. (-1,0)% } %%%%% circles in the background %%%%% \def\background[#1,#2]{ \fill[#1] (0,0) circle (3.9); \fill[#2] (0,0) circle (1); } %%%%% star and small circle in the center %%%%% \def\center[#1]{ \foreach \a in {51.4285,102.857,...,360} { % \draw[color=yellow,rotate=\a,fill=#1] (-0.08,0) -- (0,0.46) -- (0.08,0); % } \draw[color=yellow,fill=#1] (0,0) circle (0.1); } %%%%%%%%%% Mandala with fixed colouring %%%%%%%%%% \def \mandala { \background[red!30!blue!70!black,blue!70!yellow!50]; % ysh - yshift % xs - xscale % ys - yscale % af - first angle in foreach % as - second angle in foreach % y - number in the color specification after yellow % b - number in the color specification before blue % r - number in the color specification of the shading after red % bl - number in the color specification of the shading before black \foreach \ysh/\xs/\ys/\af/\as/\y/\b/\w/\r/\bl in {% 3.06/0.72/0.8/ 25.71425/51.4285/ 70/100/100/ 100/100,% 2.34/1/0.9/ 25.71425/77.14275/ 6/90/92/ 80/80,% 1.8/0.8/0.9/ 51.4285/102.857/ 0/75/100/ 60/70,% 1.5/0.6/0.6/ 25.71425/77.14275/ 0/55/100/ 40/60,% 1.1/0.53/0.58/ 51.4285/102.857/ 0/40/100/ 20/50,% 0.8/0.37/0.45/ 25.71425/77.14275/ 0/45/85/ 20/40,% 0.53/0.1/0.24/ 25.71425/77.14275/ 0/10/100/ 0/30,% 0.49/0.22/0.32/ 51.4285/102.857/ 0/10/100/ 0/50% } { \foreach \a in {\af,\as,...,360} { \begin{scope}[rotate=\a,shift={(0,\ysh)},xscale=\xs,yscale=\ys] \draw[color=yellow,fill=yellow!\y!red!\b!blue!\w] % [drop shadow={shadow xshift=0.5pt, shadow yshift=-0.5pt}] \petal; \end{scope} \begin{scope}[transform canvas={rotate=\a},shift={(0,\ysh)},xscale=\xs,yscale=\ys] \clip \petal; % \fill[path fading=fade out,fill=red!\r!blue!\bl!black, opacity=0.7]% (0,-0.35) ellipse (1.2 and 0.75); \fill[path fading=fade out,fill=red!\r!blue!\bl!black, opacity=0.3]% (0,-0.2) ellipse (1.2 and 0.4); \fill[path fading=fade out,fill=red!\r!blue,opacity=0.2] % (-0.4,0.6) -- (0,0.9) -- (0.4,0.6); \end{scope} } } \center[blue] } %%%%%%%%%% End of Mandala with fixed colouring %%%%%%%%%% %%%%% one layer of petals %%%%% \def\mainbody{ \foreach \a in {\af,\as,...,360} { \begin{scope}[rotate=\a,shift={(0,\ysh)},xscale=\xs,yscale=\ys] \draw[color=yellow,fill=\c] % [drop shadow={shadow xshift=0.5pt, shadow yshift=-0.5pt}] \petal; \end{scope} % fadings \begin{scope}[transform canvas={rotate=\a}, shift={(0,\ysh)},xscale=\xs,yscale=\ys] \clip \petal; % \fill[path fading=fade out,fill=\fc, opacity=0.7]% (0,-0.35) ellipse (1.2 and 0.75); \fill[path fading=fade out,fill=\fc, opacity=0.3]% (0,-0.2) ellipse (1.2 and 0.4); \fill[path fading=fade out,fill=\fc,opacity=0.2] % (-0.4,0.6) -- (0,0.9) -- (0.4,0.6); \end{scope} } } %%%%%%%%%%% Mandalas with parametrized colouring %%%%%%%%%% % #1 - the color of the outer most (first) layer % #2 - the color of the third layer % #3 - the color of the fifth layer % #4 - the color of the seventh layer % #5 - the color of the fading, gets denser closer to the center \def \mandalac[#1,#2,#3,#4,#5]{ \background[#3!30!#4!70!#5,#4!70!#2!50]; % ysh - yshift % xs - xscale % ys - yscale % af - first angle in foreach % as - second angle in foreach % c - color of the petal % fc - color of the fading \foreach \ysh/\xs/\ys/\af/\as/\c/\fc in {% 3.06/0.72/0.8/ 25.71425/51.4285 /#1/#1!50!#2!90!#5,% 2.34/1/0.9/ 25.71425/77.14275/#1!50!#2/#2!80!#5,% 1.8/0.8/0.9/ 51.4285/102.857 /#2/#2!50!#3!70!#5,% 1.5/0.6/0.6/ 25.71425/77.14275/#2!50!#3/#3!60!#5,% 1.1/0.53/0.58/ 51.4285/102.857 /#3/#3!50!#4!50!#5,% 0.8/0.37/0.45/ 25.71425/77.14275/#3!50!#4/#4!40!#5,% 0.53/0.1/0.24/ 25.71425/77.14275/#4/#4!50!#5,% 0.49/0.22/0.32/ 51.4285/102.857 /#4/#4!50!#5% } { \mainbody } \center[#4] } % #1 - the color of the outer most (first) layer % #2 - the color of the second layer % #3 - the color of the third layer % #4 - the color of the forth layer % #5 - the color of the fifth layer % #6 - the color of the sixth layer % #7 - the color of the seventh layer % #8 - the color of the fading, gets denser closer to the center \def \mandalab[#1,#2,#3,#4,#5,#6,#7,#8]{ \background[#6!30!#7!70!#8,#7!70!#4!50]; % ysh - yshift % xs - xscale % ys - yscale % af - first angle in foreach % as - second angle in foreach % c - color of the petal % fc - color of the fading \foreach \ysh/\xs/\ys/\af/\as/\c/\fc in {% 3.06/0.72/0.8/ 25.71425/51.4285 /#1/#2!90!#8,% 2.34/1/0.9/ 25.71425/77.14275/#2/#3!90!#8,% 1.8/0.8/0.9/ 51.4285/102.857 /#3/#4!80!#8,% 1.5/0.6/0.6/ 25.71425/77.14275/#4/#5!80!#8,% 1.1/0.53/0.58/ 51.4285/102.857 /#5/#6!70!#8,% 0.8/0.37/0.45/ 25.71425/77.14275/#6/#7!70!#8,% 0.53/0.1/0.24/ 25.71425/77.14275/#7/#7!50!#8,% 0.49/0.22/0.32/ 51.4285/102.857 /#7/#7!50!#8% } { \mainbody } \center[#7] } %%%%%%%%%%% End of Mandalas with parametrized colouring %%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%% BEGIN DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%% \pagestyle{empty} \setlength{\parindent}{0pt} \begin{document} \tikz\mandala; \tikz\mandalac[magenta!30!,magenta,purple,violet,]; \tikz\mandalac[blue!40!black,violet,purple,pink,]; \tikz\mandalac[lime!90!black,yellow!95!black,orange,red,]; \tikz\mandalac[green!80!black,yellow,pink,purple!90!,red]; \tikz\mandalab[green!50!black, green!60!black, green!70!black!80!, green!50!, green!10!, pink!40!, red!40!,]; \tikz\mandalab[blue!30!black, blue!40!black, blue!60!black, blue!70!black!80!, blue!50!, yellow!40!, yellow!70!,]; \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{etoolbox} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfdeclarelayer{sankeydebug} \pgfsetlayers{background,main,foreground,sankeydebug} \newif\ifsankeydebug \newenvironment{sankeydiagram}[1][]{ \def\sankeyflow##1##2{% sn, en \path[sankey fill] let \p1=(##1.north east),\p2=(##1.south east), \n1={atan2(\x1-\x2,\y1-\y2)-90}, \p3=(##2.north west),\p4=(##2.south west), \n2={atan2(\x3-\x4,\y3-\y4)+90} in (\p1) to[out=\n1,in=\n2] (\p3) -- (\p4) to[in=\n1,out=\n2] (\p2) -- cycle; \draw[sankey draw] let \p1=(##1.north east),\p2=(##1.south east), \n1={atan2(\x1-\x2,\y1-\y2)-90}, \p3=(##2.north west),\p4=(##2.south west), \n2={atan2(\x3-\x4,\y3-\y4)+90} in (\p1) to[out=\n1,in=\n2] (\p3) (\p4) to[in=\n1,out=\n2] (\p2); } \tikzset{ sankey tot length/.store in=\sankeytotallen, sankey tot quantity/.store in=\sankeytotalqty, sankey min radius/.store in=\sankeyminradius, sankey arrow length/.store in=\sankeyarrowlen, sankey debug/.is if=sankeydebug, sankey debug=false, sankey flow/.style={ to path={ \pgfextra{ \pgfinterruptpath \edef\sankeystart{\tikztostart} \edef\sankeytarget{\tikztotarget} \sankeyflow{\sankeystart}{\sankeytarget} \endpgfinterruptpath } }, }, sankey node/.style={ inner sep=0,minimum height={sankeyqtytolen(##1)}, minimum width=0,draw=none,line width=0pt, }, % sankey angle sankey angle/.store in=\sankeyangle, % sankey default styles sankey fill/.style={line width=0pt,fill,white}, sankey draw/.style={draw=black,line width=.4pt}, } \newcommand\sankeynode[4]{%prop,orientation,name,pos \node[sankey node=##1,rotate=##2] (##3) at (##4) {}; \ifsankeydebug \begin{pgfonlayer}{sankeydebug} \draw[red,|-|] (##3.north west) -- (##3.south west); \pgfmathsetmacro{\len}{sankeyqtytolen(##1)/3} \draw[red] (##3.west) -- ($(##3.west)!\len pt!90:(##3.south west)$) node[font=\tiny,text=black] {##3}; \end{pgfonlayer} \fi } \newcommand\sankeynodestart[4]{%prop,orientation,name,pos \sankeynode{##1}{##2}{##3}{##4} \begin{scope}[shift={(##3)},rotate=##2] \path[sankey fill] (##3.north west) -- ++(-\sankeyarrowlen,0) -- ([xshift=-\sankeyarrowlen/6]##3.west) -- ([xshift=-\sankeyarrowlen]##3.south west) -- (##3.south west) -- cycle; \path[sankey draw] (##3.north west) -- ++(-\sankeyarrowlen,0) -- ([xshift=-\sankeyarrowlen/6]##3.west) -- ([xshift=-\sankeyarrowlen]##3.south west) -- (##3.south west); \end{scope} } \newcommand\sankeynodeend[4]{%prop,orientation,name,pos \sankeynode{##1}{##2}{##3}{##4} \begin{scope}[shift={(##3)},rotate=##2] \path[sankey fill] (##3.north east) -- ([xshift=\sankeyarrowlen]##3.east) -- (##3.south west) -- cycle; \path[sankey draw] (##3.north east) -- ([xshift=\sankeyarrowlen]##3.east) -- (##3.south west); \end{scope} } \newcommand\sankeyadvance[3][]{%newname,name,distance \edef\name{##2} \ifstrempty{##1}{ \def\newname{##2} \edef\name{##2-old} \path [late options={name=##2,alias=\name}]; }{ \def\newname{##1} } \path let % sankey node angle \p1=(##2.north east), \p2=(##2.south east), \n1={atan2(\x1-\x2,\y1-\y2)-90}, % sankey prop \p3=($(\p1)-(\p2)$), \n2={sankeylentoqty(veclen(\x3,\y3))}, % next position \p4=($(##2.east)!##3!-90:(##2.north east)$) in \pgfextra{ \pgfmathsetmacro{\prop}{\n2} \pgfinterruptpath \sankeynode{\prop}{\n1}{\newname}{\p4} \path (\name) to[sankey flow] (\newname); \endpgfinterruptpath }; } \newcommand\sankeyturn[3][]{%newname,name,angle \edef\name{##2} \ifstrempty{##1}{ \def\newname{##2} \edef\name{##2-old} \path [late options={name=##2,alias=\name}]; }{ \def\newname{##1} } \ifnumgreater{##3}{0}{ \typeout{turn acw: ##3} \path let % sankey node angle \p1=(##2.north east), \p2=(##2.south east), \p3=($(\p1)!-\sankeyminradius!(\p2)$), \n1={atan2(\x1-\x2,\y1-\y2)-90}, % sankey prop \p4=($(\p1)-(\p2)$), \n2={sankeylentoqty(veclen(\x4,\y4))}, \p5=(##2.east), \p6=($(\p3)!1!##3:(\p5)$) in \pgfextra{ \pgfmathsetmacro{\prop}{\n2} \pgfinterruptpath % \fill[red] (\p3) circle (2pt); % \fill[blue](\p6) circle (2pt); \sankeynode{\prop}{\n1+##3}{\newname}{\p6} \path (\name) to[sankey flow] (\newname); \endpgfinterruptpath }; }{ \typeout{turn acw: ##3} \path let % sankey node angle \p1=(##2.south east), \p2=(##2.north east), \p3=($(\p1)!-\sankeyminradius!(\p2)$), \n1={atan2(\x1-\x2,\y1-\y2)+90}, % sankey prop \p4=($(\p1)-(\p2)$), \n2={sankeylentoqty(veclen(\x4,\y4))}, \p5=(##2.east), \p6=($(\p3)!1!##3:(\p5)$) in \pgfextra{ \pgfmathsetmacro{\prop}{\n2} \pgfinterruptpath % \fill[red] (\p3) circle (2pt); % \fill[blue](\p6) circle (2pt); \sankeynode{\prop}{\n1+##3}{\newname}{\p6} \path (\name) to[sankey flow] (\newname); \endpgfinterruptpath }; } } \newcommand\sankeyfork[2]{%name,list of forks \def\name{##1} \def\listofforks{##2} \xdef\sankeytot{0} \path let % sankey node angle \p1=(\name.north east), \p2=(\name.south east), \n1={atan2(\x1-\x2,\y1-\y2)-90}, % sankey prop \p4=($(\p1)-(\p2)$), \n2={sankeylentoqty(veclen(\x4,\y4))} in \pgfextra{ \pgfmathsetmacro{\iprop}{\n2} } \foreach \prop/\name[count=\c] in \listofforks { let \p{start \name}=($(\p1)!\sankeytot/\iprop!(\p2)$), \n{nexttot}={\sankeytot+\prop}, \p{end \name}=($(\p1)!\n{nexttot}/\iprop!(\p2)$), \p{mid \name}=($(\p{start \name})!.5!(\p{end \name})$) in \pgfextra{ \xdef\sankeytot{\n{nexttot}} \pgfinterruptpath \sankeynode{\prop}{\n1}{\name}{\p{mid \name}} \endpgfinterruptpath } } \pgfextra{ \pgfmathsetmacro{\diff}{abs(\iprop-\sankeytot)} \pgfmathtruncatemacro{\finish}{\diff<0.01?1:0} \ifnumequal{\finish}{1}{}{ \message{*** Warning: bad sankey fork (maybe)...} \message{\iprop-\sankeytot} } }; } \tikzset{ % default values, declare function={ sankeyqtytolen(\qty)=\qty/\sankeytotalqty*\sankeytotallen; sankeylentoqty(\len)=\len/\sankeytotallen*\sankeytotalqty; }, sankey tot length=100pt, sankey tot quantity=100, sankey min radius=30pt,% sankey arrow length=10pt,% % user values #1} }{ } \begin{document} \begin{tikzpicture}[x=1pt,y=1pt] \begin{sankeydiagram}[ sankey tot length=90pt,% sankey tot quantity=6,% sankey min radius=15pt,% sankey fill/.style={ draw,line width=0pt, fill, lime!50, }, sankey draw/.style={ draw=black, line width=1pt, line cap=round, line join=round, }, %sankey debug, ] \sankeynodestart{6}{-90}{p0}{0,100}; \sankeyadvance{p0}{50pt} \sankeyfork{p0}{3/p1,3/p2} \sankeyturn{p1}{90} \sankeyadvance{p1}{20pt} \sankeyadvance{p2}{60pt} \sankeyfork{p2}{2/p3,1/p4} \sankeyturn{p3}{90} \sankeyadvance{p3}{50pt} \sankeyfork{p3}{1/p5,1/p6} \sankeyadvance{p5}{70pt} \sankeyfork{p1}{1/p7,1/p8,1/p9} \sankeyadvance{p7}{50pt} \sankeyadvance{p9}{50pt} \sankeyadvance{p4}{40pt} \sankeyturn{p4}{90} \sankeyadvance{p4}{65pt} \sankeyadvance{p7}{40pt} \sankeynode{3}{0}{p11}{[shift={(50pt,-15pt)}]p7} \sankeyfork{p11}{1/p7a,1/p9a,1/p5a} \path (p7) to[sankey flow] (p7a); \path (p9) to[sankey flow] (p9a); \path (p5) to[sankey flow] (p5a); \sankeyadvance{p11}{30pt} \sankeynodeend{3}{0}{p11}{p11} { \tikzset{ sankey fill/.append style={ line width=0pt, lime!50!green!50, } } \sankeyturn{p8}{-90} \sankeyadvance{p8}{40pt} \sankeyturn{p6}{-90} \sankeyturn{p4}{-90} \sankeynode{3}{-90}{p10}{[shift={(-15pt,-60pt)}]p8} \sankeyfork{p10}{1/p8a,1/p6a,1/p4a} \path (p4) to[sankey flow] (p4a); \path (p6) to[sankey flow] (p6a); \path (p8) to[sankey flow] (p8a); \sankeyadvance{p10}{30pt} \sankeynodeend{3}{-90}{p10}{p10} } \end{sankeydiagram} \end{tikzpicture} \end{document}
\documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{shadows,arrows} % Define the layers to draw the diagram \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} % Define block styles \tikzstyle{materia}=[draw, fill=blue!20, text width=6.0em, text centered, minimum height=1.5em,drop shadow] \tikzstyle{practica} = [materia, text width=8em, minimum width=10em, minimum height=3em, rounded corners, drop shadow] \tikzstyle{texto} = [above, text width=6em, text centered] \tikzstyle{linepart} = [draw, thick, color=black!50, -latex', dashed] \tikzstyle{line} = [draw, thick, color=black!50, -latex'] \tikzstyle{ur}=[draw, text centered, minimum height=0.01em] % Define distances for bordering \newcommand{\blockdist}{1.3} \newcommand{\edgedist}{1.5} \newcommand{\practica}[2]{node (p#1) [practica] {Pr\'actica #1\\{\scriptsize\textit{#2}}}} % Draw background \newcommand{\background}[5]{% \begin{pgfonlayer}{background} % Left-top corner of the background rectangle \path (#1.west |- #2.north)+(-0.5,0.5) node (a1) {}; % Right-bottom corner of the background rectanle \path (#3.east |- #4.south)+(+0.5,-0.25) node (a2) {}; % Draw the background \path[fill=yellow!20,rounded corners, draw=black!50, dashed] (a1) rectangle (a2); \path (a1.east |- a1.south)+(0.8,-0.3) node (u1)[texto] {\scriptsize\textit{Unidad #5}}; \end{pgfonlayer}} \newcommand{\transreceptor}[3]{% \path [linepart] (#1.east) -- node [above] {\scriptsize Transreceptor #2} (#3);} \begin{document} \begin{tikzpicture}[scale=0.7,transform shape] % Draw diagram elements \path \practica {1}{Diferencias en componentes electr\'onicos}; \path (p1.south)+(0.0,-1.0) \practica{2}{Serie de Fourier}; \path (p2.south)+(-2.5,-1.5) \practica{3}{Antena para HF}; \path (p3.south)+(0.0,-1.0) \practica{5}{Medidor de SWR}; \path (p3.south)+(5.0,-1.0) \practica{4}{Amplificador para HF}; \path (p4.south)+(-2.5,-1.5) \practica{6}{Oscilador de RF}; \path (p6.south)+(-2.5,-1.25) \practica{7}{Modulador AM}; \path (p6.south)+(2.5,-1.25) \practica{8}{Demodulador AM}; \path (p8.east)+(+5.5,0) node (ur1)[ur] {}; \path (p7.south)+(0.0,-1.5) \practica{9}{Codificador digital}; \path (p8.south)+(0.0,-1.5) \practica{10}{Decodificador digital}; \path (p10.east)+(+5.5,0) node (ur2)[ur] {}; \path (p9.south)+(0.0,-1.5) \practica{11}{Codificador FDM}; \path (p10.south)+(0.0,-1.5) \practica{12}{Decodificador FDM}; \path (p12.east)+(+5.5,0) node (ur3)[ur] {}; \path (p11.south)+(0.0,-1.5) \practica{13}{Codificador SSTV}; \path (p12.south)+(0.0,-1.5) \practica{14}{Decodificador SSTV}; \path (p14.east)+(+5.5,0) node (ur4)[ur] {}; \path (p14.south)+(-2.5,-1.5) \practica{15}{Conmutaci\'on telef\'onica}; \path (p15.south)+(0.0,-1.0) \practica{16}{Telfon\'ia celular an\'aloga}; \path (p16.south)+(0.0,-1.5) \practica{17}{Receptor de telemetr\'ia}; \path (p17.south)+(0.0,-1.5) \practica{18}{Gu\'ias de ondas}; % Draw arrows between elements \path [line] (p1.south) -- node [above] {} (p2); \path [line] (p2.south) -- +(0.0,-0.5) -- +(-2.5,-0.5) -- node [above, midway] {} (p3); \path [line] (p3.south) -- node [above] {} (p5) ; \path [line] (p2.south) -- +(0.0,-0.5) -- +(+2.5,-0.5) -- node [above, midway] {} (p4); \path [linepart] (p3.east) -- +(+0.5,-0.0) -- +(+0.5,-1.75) -- node [left, midway] {} (p4); \path [linepart] (p3.east) -- +(+0.5,-0.0) -- +(+0.5,-1.75) -- node [left, midway] {} (p4); \path [line] (p4.south) -- +(0.0,-0.5) -- +(-2.5,-0.5) -- node [above, midway] {} (p6); \path [line] (p5.south) -- +(0.0,-0.5) -- +(+2.5,-0.5) -- node [above, midway] {} (p6); \path [linepart] (p2.east) -- +(2.75,0.0) -- +(2.75,-5.85) -- node [right] {} (p6); \path [line] (p6.south) -- +(0.0,-0.25) -- +(-2.5,-0.25) -- node [above, midway] {} (p7); \path [line] (p6.south) -- +(0.0,-0.25) -- +(+2.5,-0.25) -- node [above, midway] {} (p8); \path [linepart] (p7.east) -- node [left] {} (p8); \transreceptor{p8}{AM banda 40m}{ur1} \path [line] (p7.south) -- node [above] {} (p9) ; \path [line] (p8.south) -- node [above] {} (p10) ; \path [linepart] (p9.east) -- node [left] {} (p10); \transreceptor{p10}{CW}{ur2} \path [line] (p9.south) -- node [above] {} (p11) ; \path [line] (p10.south) -- node [above] {} (p12) ; \path [linepart] (p11.east) -- node [left] {} (p12); \transreceptor{p12}{FDMDV}{ur3} \path [line] (p11.south) -- node [above] {} (p13) ; \path [line] (p12.south) -- node [above] {} (p14) ; \path [linepart] (p13.east) -- node [left] {} (p14); \transreceptor{p14}{SSTV}{ur4} \path [line] (p14.south) -- +(0.0,-0.5) -- +(-2.5,-0.5) -- node [above, midway] {} (p15); \path [line] (p13.south) -- +(0.0,-0.5) -- +(+2.5,-0.5) -- node [above, midway] {} (p15); \path [line] (p15.south) -- node [above] {} (p16) ; \path [line] (p16.south) -- node [above] {} (p17) ; \path [line] (p17.south) -- node [above] {} (p18) ; \background{p3}{p1}{p4}{p2}{I} \background{p3}{p3}{p4}{p5}{II} \background{p3}{p6}{p4}{p7}{III} \background{p3}{p9}{p4}{p10}{IV} \background{p3}{p11}{p4}{p12}{V} \background{p3}{p13}{p4}{p14}{VI} \background{p3}{p15}{p4}{p16}{VII} \background{p3}{p17}{p4}{p17}{VIII} \background{p3}{p18}{p4}{p18}{IX} \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \begin{document} \pagestyle{empty} % Agents \def\Households{Households} \def\Firms{Firms} \def\Banks{Banks} % Money Flows \def\DF{D_{F,t}} \def \DB {D_{B,t}} \def\Dividends{Dividends} \def\NL{\mathit{NL}_{t}} \def\NewLoans{New loans} \def\WB{\mathit{WB}_{t}} \def\Wages{Wages} \def\SA{C_{t}} \def\Consumption{Consumption} \def\INT{\mathit{INT}_t} \def\Interests{Interests} \def\RL{\mathit {RL}_{t}} \def\PaidBackLoans{Paid back loans} % Diagram \begin{tikzpicture}[every node/.style={font=\normalsize, minimum height=0.5cm,minimum width=0.5cm},] % Matrix \node [matrix, very thin,column sep=1.3cm,row sep=0.5cm] (matrix) at (0,0) { & \node(0,0) (\Households) {}; & & \node(0,0) (\Firms) {}; & & \node(0,0) (\Banks) {}; & \\ & \node(0,0) (\Households 0) {}; & & \node(0,0) (\Firms 0) {}; & & & \\ \node(0,0) (t0 left) {}; & & & & & & \node(0,0) (t0 right) {};\\ & \node(0,0) (\Households 1) {}; & \node(0,0) (\Dividends 1) {}; & \node(0,0) (\Firms 1) {}; & & & \\ \node(0,0) (t1 left) {}; & & & & & & \node(0,0) (t1 right) {};\\ & \node(0,0) (\Households 2) {}; & \node(0,0) (\Dividends 2) {}; & \node(0,0) (\Firms 2) {}; & & \node(0,0) (\Banks 2) {}; & \\ \node(0,0) (t2 left) {}; & & & & & & \node(0,0) (t2 right) {};\\ & & & \node(0,0) (\Firms 3) {}; & \node(0,0) (\NewLoans) {}; & \node(0,0) (\Banks 3) {}; & \\ \node(0,0) (t3 left) {}; & & & & & & \node(0,0) (t3 right) {};\\ & \node(0,0) (\Households 4) {}; & \node(0,0) (\Wages) {}; & \node(0,0) (\Firms 4) {}; & & & \\ \node(0,0) (t4 left) {}; & & & & & & \node(0,0) (t4 right) {};\\ & \node(0,0) (\Households 5) {}; & \node(0,0) (\Consumption) {}; & \node(0,0) (\Firms 5) {}; & & & \\ \node(0,0) (t5 left) {}; & & & & & & \node(0,0) (t5 right) {};\\ & & & \node(0,0) (\Firms 6) {}; & \node(0,0) (\Interests) {}; & \node(0,0) (\Banks 6) {}; & \\ \node(0,0) (t6 left) {}; & & & & & & \node(0,0) (t6 right) {};\\ & & & \node(0,0) (\Firms 7) {}; & \node(0,0) (\PaidBackLoans) {}; & \node(0,0) (\Banks 7) {}; & \\ \node(0,0) (t7 left) {}; & & & & & & \node(0,0) (t7 right) {};\\ & \node(0,0) (\Households 8) {}; & & \node(0,0) (\Firms 8) {}; & & & \\ & \node(0,0) (\Households 9) {}; & & \node(0,0) (\Firms 9) {}; & & \node(0,0) (\Banks 9) {}; & \\ }; % Agents labels \fill (\Households) node[draw,fill=white] {\Households} (\Firms) node[draw,fill=white] {\Firms} (\Banks) node[draw,fill=white] {\Banks}; % Horizontal time lines \draw [dotted] (t0 left) -- (t0 right) node[right] {$t+\frac{0}{7}$} (t1 left) -- (t1 right) node[right] {$t+\frac{1}{7}$} (t2 left) -- (t2 right) node[right] {$t+\frac{2}{7}$} (t3 left) -- (t3 right) node[right] {$t+\frac{3}{7}$} (t4 left) -- (t4 right) node[right] {$t+\frac{4}{7}$} (t5 left) -- (t5 right) node[right] {$t+\frac{5}{7}$} (t6 left) -- (t6 right) node[right] {$t+\frac{6}{7}$} (t7 left) -- (t7 right) node[right] {$t+\frac{7}{7}$}; % Available balances at the beginning of the period \draw (\Households 0) node[draw,isosceles triangle,fill=yellow!20, rotate=-90] (\Households Balance In) {} node[below right] {$M_{H,t}$} (\Firms 0) node[draw,isosceles triangle,fill=yellow!20, rotate=-90] (\Firms Balance In) {} node[below right] {$M_{F,t}$}; % Available balances at the end of the period \draw (\Households 8) node[draw,isosceles triangle,fill=yellow!20, rotate=-90] (\Households Balance Out) {} node[below right] {$M_{H,t+1}$} (\Firms 8) node[draw,isosceles triangle,fill=yellow!20, rotate=-90] (\Firms Balance Out) {} node[below right] {$M_{F,t+1}$}; % Vertical lifelines \draw [dashed] (\Households) -- (\Households Balance In.west) (\Households Balance Out.east) -- (\Households 9) (\Firms) -- (\Firms Balance In.west) (\Firms Balance Out.east) -- (\Firms 9) (\Banks) -- (\Banks 9); % Vertical flows (Intertemporal transfers) \draw [-latex] (\Households Balance In.east) -- (\Households 1); \draw [-latex] (\Firms Balance In.east) -- (\Firms 1); \draw [-latex] (\Firms 1) -- (\Firms 3); \draw [-latex] (\Firms 4) -- (\Firms 5); \draw [-latex] (\Households 5) -- (\Households Balance Out.west); \draw [-latex] (\Firms 7) -- (\Firms Balance Out.west); % Blocks (Budget constraints) \filldraw[fill=blue!20] (\Firms 1.north west) rectangle (\Firms 1.south east) (\Households 1.north west) rectangle (\Households 5.south east) (\Firms 3.north west) rectangle (\Firms 4.south east) (\Firms 5.north west) rectangle (\Firms 7.south east); % Horizontal flows (Monetary interactions) \draw [-latex] (\Firms 1) -- (\Households 1); \draw [-latex] (\Banks 2) -- (\Firms 2.east) arc(0:180:0.25cm) -- (\Households 2); \draw [-latex] (\Banks 3) -- (\Firms 3); \draw [-latex] (\Firms 4) -- (\Households 4); \draw [-latex] (\Households 5) -- (\Firms 5); \draw [-latex] (\Firms 6) -- (\Banks 6); \draw [-latex] (\Firms 7) -- (\Banks 7); % Flows Labels \fill (\Dividends 1) node[above] {$\DF$} node[font=\footnotesize, below] {\Dividends} (\Dividends 2) node[above] {$\DB$} node[font=\footnotesize, below] {\Dividends} (\NewLoans) node[above] {$\NL$} node[font=\footnotesize, below] {\NewLoans} (\Wages) node[above] {$\WB$} node[font=\footnotesize, below] {\Wages} (\Consumption) node[above] {$\SA$} node[font=\footnotesize, below] {\Consumption} (\Interests) node[above] {$\INT$} node[font=\footnotesize, below] {\Interests} (\PaidBackLoans) node[above] {$\RL$} node[font=\footnotesize, below] {\PaidBackLoans}; % Money creation \draw (\Banks 2) node[draw,circle,fill=green!20] {} node {+} (\Banks 3) node[draw,circle,fill=green!20] {} node {+}; % Money destruction \draw (\Banks 6) node[draw,circle,fill=red!20] {-} (\Banks 7) node[draw,circle,fill=red!20] {-}; \end{tikzpicture} \end{document}
\documentclass[11pt]{article} \usepackage{tikz} \usepackage{tikz-3dplot} %%%%%%%%%%% %% helper macros %: Styles for XYZ-Coordinate Systems %: isometric South West : X , South East : Y , North : Z \tikzset{isometricXYZ/.style={x={(-0.866cm,-0.5cm)}, y={(0.866cm,-0.5cm)}, z={(0cm,1cm)}}} %: isometric South West : Z , South East : X , North : Y \tikzset{isometricZXY/.style={x={(0.866cm,-0.5cm)}, y={(0cm,1cm)}, z={(-0.866cm,-0.5cm)}}} %: isometric South West : Y , South East : Z , North : X \tikzset{isometricYZX/.style={x={(0cm,1cm)}, y={(-0.866cm,-0.5cm)}, z={(0.866cm,-0.5cm)}}} %% document-wide tikz options and styles \begin{document} \begin{tikzpicture} [scale=4, isometricZXY, line join=round, opacity=.75, text opacity=1.0,% >=latex, inner sep=0pt,% outer sep=2pt,% ] \def\h{5} \newcommand{\quadrant}[2]{ \foreach \t in {#1} \foreach \f in {175,165,...,5} \draw [fill=#2] ({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)}) -- ({sin(\f - \h)*cos(\t + \h)}, {sin(\f - \h)*sin(\t + \h)}, {cos(\f - \h)}) -- ({sin(\f + \h)*cos(\t + \h)}, {sin(\f + \h)*sin(\t + \h)}, {cos(\f + \h)}) -- ({sin(\f + \h)*cos(\t - \h)}, {sin(\f + \h)*sin(\t - \h)}, {cos(\f + \h)}) -- cycle; } %Quadrants \quadrant{220,230,...,300}{black} \quadrant{-60,-50,...,20}{white} \quadrant{30,40,...,120}{black} \quadrant{130,140,...,210}{none} %Movement arrows \foreach \t in {225,235,...,295} \foreach \f in {50,40,...,0} \draw [red, opacity=1.0, ->, thick] ({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)}) -- ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}); \foreach \t in {125,135,...,205} \foreach \f in {110,100,...,0} \draw [black, ->, thick] ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}) -- ({sin(\f - \h)*cos(\t - \h)},{sin(\f - \h)*sin(\t - \h)},{cos(\f - \h)}); \foreach \t in {35,45,...,115} \foreach \f in {130,120,...,0} \draw [red, opacity=1.0 ,->, thick] ({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)}) -- ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}); \foreach \t in {-55,-45,...,25} \foreach \f in {130,120,...,0} \draw [black, ->, thick] ({(1 + 0.2*cos(90 - \f))*sin(\f - \h)*cos(\t - \h)}, {(1 + 0.2*cos(90 - \f))*sin(\f - \h)*sin(\t - \h)}, {(1 + 0.2*cos(90 - \f))*cos(\f - \h)}) -- ({sin(\f - \h)*cos(\t - \h)},{sin(\f - \h)*sin(\t - \h)},{cos(\f - \h)}); %Annotations \path ({1.5*sin(100)*cos(75)}, {1.5*sin(100)*sin(75)}, {1.5*cos(100)}) node [right] {Compression}; \path ({1.5*sin(70)*cos(-15)}, {1.5*sin(70)*sin(-15)}, {1.5*cos(70)}) node [right] {Dilatation}; \path ({1.25*sin(50)*cos(165)},{1.25*sin(50)*sin(165)},{1.25*cos(50)}) node [left] {Dilatation}; \path ({1.25*sin(30)*cos(255)},{1.25*sin(30)*sin(255)},{1.25*cos(30)}) node [left] {Compression}; %P and T axis \begin{scope}[ultra thick] \draw[->] ({1.75*sin(90)*cos(75)}, {1.75*sin(90)*sin(75)}, {1.75*cos(90)}) -- ({2*sin(90)*cos(75)},{2*sin(90)*sin(75)},{2*cos(90)}) node [above] {T-axis}; \draw[->] ({1.75*sin(90)*cos(255)},{1.75*sin(90)*sin(255)},{1.75*cos(90)}) -- ({2*sin(90)*cos(255)},{2*sin(90)*sin(255)},{2*cos(90)}) node [below] {T-axis}; \draw[<-] ({1.5*sin(90)*cos(-15)}, {1.5*sin(90)*sin(-15)}, {1.5*cos(90)}) -- ({1.75*sin(90)*cos(-15)},{1.75*sin(90)*sin(-15)},{1.75*cos(90)}) node [right] {P-axis}; \draw[<-] ({1.5*sin(90)*cos(165)}, {1.5*sin(90)*sin(165)}, {1.5*cos(90)}) -- ({1.75*sin(90)*cos(165)},{1.75*sin(90)*sin(165)},{1.75*cos(90)}) node [left] {P-axis}; \end{scope} % Label \node [anchor=north, yshift=-2mm] at (current bounding box.south) {Seismic focal mechanism and Pression-Tension axis.}; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,fit} \begin{document} \newcounter{parlevel} \newcounter{serlevel} %define a parallel block: a tikz-pic with two nodes drawn on top of each other and some connecting lines %the node contents comes from #1 and #2 %the two nodes are named &#39;nTsp&#39; and &#39;nBsp&#39; where s and p are serial and parallel levels which increment \newcommand{\parblock}[2] { \tikz[baseline,remember picture,inner sep=0pt,outer sep=0pt,node distance=0.25cm] { \addtocounter{parlevel}{1} %special names for the two nodes: \def\nTsp{nT-\arabic{serlevel}-\arabic{parlevel}} \def\nBsp{nB-\arabic{serlevel}-\arabic{parlevel}} % %define the two nodes: \node(\nTsp){#1}; \node[below=of \nTsp](\nBsp){#2}; % %use bounding box so that the lines are based on the widest one \path (current bounding box.west) -- +(-0.125,0) coordinate (source); \path (current bounding box.east) -- +( 0.125,0) coordinate (dest); % %draw up/down and across from source (left) \draw (source) |- (\nTsp.west); \draw (source) |- (\nBsp.west); % %draw across and up/down to dest (right) \draw (\nTsp.east) -| (dest); \draw (\nBsp.east) -| (dest); % %add extra horizontal lines at source and dest \draw (source) -- +(-0.125,0); \draw (dest) -- +( 0.125,0); \addtocounter{parlevel}{-1} } } \newcommand{\block}[1] { \tikz[baseline,remember picture,inner sep=2pt] { \node[draw,shape=rectangle](#1){#1}; } } %define a series block: a tikz-pic with two nodes drawn next to each other and some connecting lines %the node contents comes from #1 and #2 %the two nodes are named &#39;nAsp&#39; and &#39;nBsp&#39; where x,y are serial and parallel levels which increment \newcommand{\serblock}[2] { \tikz[baseline,remember picture,inner sep=0pt,outer sep=0pt,node distance=0.25cm] { \addtocounter{serlevel}{1} %special names for the two nodes: \def\nLsp{nL-\arabic{serlevel}-\arabic{parlevel}} \def\nRsp{nR-\arabic{serlevel}-\arabic{parlevel}} % %define the two nodes: \node(\nLsp){#1}; \node[right=of \nLsp](\nRsp){#2}; % %define source and dest just past the nAsp and nBsp nodes \path (\nLsp.west) -- +(-0.125,0) coordinate (source); \path (\nRsp.east) -- +( 0.125,0) coordinate (dest); % %add lines at extreme ends \draw (source) -- (\nLsp.west); \draw (\nLsp.east) -- (\nRsp.west); \draw (\nRsp.east) -- (dest); \addtocounter{serlevel}{-1} } } \begin{figure} \centering \parblock{\block{top}}{\block{bottom}} \caption{Parallel block} \end{figure} \begin{figure} \centering \serblock{\block{left}}{\block{right}} \caption{Series block} \end{figure} \begin{figure} \centering \parblock {\serblock{\block{top-left}}{\block{top-right}}} {\serblock{\block{bottom-left}}{\block{bottom-right}}} \caption{Series blocks in parallel} \end{figure} \begin{figure} \centering \serblock {\parblock{\block{left-top}}{\block{left-bottom}}} {\parblock{\block{right-top}}{\block{right-bottom}}} \caption{Parallel blocks in series} \end{figure} \begin{figure} \centering \serblock {\serblock{\block{left-left}}{\block{left-right}}} {\serblock{\block{right-left}}{\block{right-right}}} \caption{Series blocks in series} \end{figure} \begin{figure} \centering \parblock {\parblock{\block{top-top}}{\block{top-bottom}}} {\parblock{\block{bottom-top}}{\block{bottom-bottom}}} \caption{Parallel blocks in Parallel} \end{figure} \begin{figure} \centering \parblock {\parblock{\parblock{\block{t-t-t}}{\block{t-t-b}}}{\parblock{\block{t-b-t}}{\block{t-b-b}}}} {\parblock{\parblock{\block{b-t-t}}{\block{b-t-b}}}{\parblock{\block{b-b-t}}{\block{b-b-b}}}} \caption{Parallel blocks in parallel, in parallel} \end{figure} \begin{figure} \centering \serblock {\parblock{\parblock{\block{l-t-t}}{\block{l-t-b}}}{\parblock{\block{l-b-t}}{\block{l-b-b}}}} {\parblock{\parblock{\block{r-t-t}}{\block{r-t-b}}}{\parblock{\block{r-b-t}}{\block{r-b-b}}}} \caption{Parallel blocks in parallel, in series} \end{figure} \begin{figure} \centering \serblock {\parblock{\serblock{\parblock{\serblock{\block{}}{\serblock{\parblock{\block{}}{\block{}}}{\block{}}}} {\serblock{\parblock{\serblock{\parblock{\block{}}{\block{}}}{\block{}}}{\block{}}}{\block{}}}} {\parblock{\serblock{\parblock{\block{}}{\block{}}} {\block{}}}{\serblock{\parblock{\serblock{\block{}}{\block{}}}{\parblock{\block{}}{\block{}}}} {\serblock{\block{}}{\block{}}}}}} {\serblock{\parblock{\parblock{\serblock{\parblock{\serblock{\block{}}{\block{}}}{\serblock{\parblock{\block{}}{\block{}}} {\block{}}}}{\parblock{\block{}}{\serblock{\parblock{\serblock{\block{}}{\block{}}} {\parblock{\block{}}{\block{}}}}{\serblock{\block{}}{\block{}}}}}} {\serblock{\parblock{\block{}}{\serblock{\parblock{\serblock{\block{}}{\block{}}} {\parblock{\block{}}{\block{}}}}{\serblock{\block{}}{\block{}}}}}{\parblock{\serblock{\block{}} {\block{}}}{\serblock{\parblock{\block{}}{\block{}}}{\block{}}}}}}{\serblock{\parblock{\serblock{\block{}} {\block{}}}{\parblock{\block{}}{\block{}}}}{\serblock{\block{}}{\block{}}}}} {\parblock{\serblock{\parblock{\serblock{\block{}}{\block{}}}{\serblock{\parblock{\block{}} {\block{}}}{\block{}}}}{\serblock{\parblock{\block{}}{\block{}}}{\block{}}}}{\serblock{\parblock{\block{}} {\block{}}}{\block{}}}}}} {\parblock{\block{}}{\block{}}} \caption[Series and Parallel graph diagram]{This example shows latex macros which nest tikz environments together to generate series and parallel graph diagrams. This shows an example of latex-macros and nesting of tikz environments being used to draw large recursively-defined (nested) diagrams.} \end{figure} \end{document}
\documentclass{article} \thispagestyle{empty} %\def\pgfsysdriver{pgfsys-tex4ht.def} \usepackage{tikz} \begin{document} \begin{tikzpicture} % \x runs over the angles at which to draw the circles defining the % torus \foreach \x in {90,89,...,-90} { % change 89 to 80 or 45 for speed % \elrad is the x-radius of the ellipse (technically, a circle seen % from side on at angle \x). The 'max' is because at small angles % then the real ellipse is too thin and the torus doesn't ``fill % out'' nicely. \pgfmathsetmacro\elrad{20*max(cos(\x),.1)} % We draw the torus from the back to the front to get the right % layering effect. To tint it, we define colours according to the % angle, but need different colours for the left and right pieces. % It'd be nice if the xcolor colour specification could take something % computed by pdfmath, such as {red!\tint} but it doesn't appear to % work, so we define the colours explicitly. \pgfmathsetmacro\ltint{.9*abs(\x-45)/180} \pgfmathsetmacro\rtint{.9*(1-abs(\x+45)/180)} \definecolor{currentcolor}{rgb}{\ltint, 0, \ltint} % This draws the right-hand circle. \draw[color=currentcolor,fill=currentcolor] (xyz polar cs:angle=\x,y radius=.75,x radius=1.5) ellipse (\elrad pt and 20pt); % This sets the colour correctly for the left-hand circle ... \definecolor{currentcolor}{rgb}{\rtint, 0, \rtint} % ... and draws it \draw[color=currentcolor,fill=currentcolor] (xyz polar cs:angle=180-\x,radius=.75,x radius=1.5) ellipse (\elrad pt and 20pt); % End of foreach statement } % Spheres are *much* easier! \shadedraw[shading=ball,ball color=purple, white] (6.5,0) circle (1.5); % As are the subsets of Euclidean space \draw[fill=cyan] (-1,-4) rectangle (1,-3); \draw[fill=cyan] (5.5,-4) rectangle (7.5,-3); % The next three draw the maps, slightly curved for aesthetics. \draw[->] (0,-2.8) .. controls (-.2,-2.2) .. (0,-1.6) node[pos=0.5, auto=left] {\(\psi\)}; \draw[->] (6.5,-1.6) .. controls (6.7,-2.2) .. (6.5,-2.8) node[pos=0.5, auto=left] {\(\phi^{-1}\)}; \draw[->] (2.5,0) .. controls (3.5,.2) .. (4.5,0) node[pos=0.5, auto=left] {\(f\)}; % Now we want to draw the codomains of the charts. Sticking cosines % and sines directly into the coordinates doesn't seem to work so % we define macros to hold the sines and cosines of the angles. % \elrad is the angle on the torus at which to start. \pgfmathsetmacro\elrad{cos(-135)} % the circle drawn at the specific angle on the torus looks like an % ellipse, \xrad and \yrad compute its major and minor semi-axes. \pgfmathsetmacro\xrad{1.5cm-20pt*\elrad} \pgfmathsetmacro\yrad{.75cm-20pt*sin(-135)} % This draws the codomain of the chart on the torus. \path[fill=cyan, fill opacity=.35] (xyz polar cs:angle=-135,radius=.75,x radius=1.5) ++(20pt*\elrad,0) arc (0:45:20*\elrad pt and 20pt) arc (-135:-45:\xrad pt and \yrad pt) arc (45:-45:-20*\elrad pt and 20pt) arc (-45:-135:\xrad pt and \yrad pt) arc (-45:0:20*\elrad pt and 20pt); % Now we do the same for the sphere. % We do this by drawing some great circles (aka ellipses) on the % sphere and then ``clipping'' an overlaid (and slightly trans:parent) % sphere by those great circles. Each great circle actually specifies % one side of the ``clip'' so to make sure that the clip is big enough % the arcs are completed by big rectangles (otherwise the clipping % would join the end points directly). \pgfmathsetmacro\tell{-sin(10)} \pgfmathsetmacro\bell{sin(50)} \pgfmathsetmacro\rell{1.5 * sin(50)} \begin{scope} \clip (6.5,0) +(-1.5,0) arc (-180:0:1.5 and 1.5*\tell) -- ++(0,-1.5) -- ++(-3,0) -- ++(0,1.5); \clip (6.5,0) +(-1.5,0) arc (-180:0:1.5 and 1.5*\bell) -- ++(0,1.5) -- ++(-3,0) -- ++(0,-1.5); \clip (6.5,0) +(0,1.5) arc (90:-90:\rell cm and 1.5 cm) -- ++(-1.5,0) -- ++(0,3) -- ++(1.5,0); \clip (6.5,0) +(0,1.5) arc (90:-90:-\rell cm and 1.5 cm) -- ++(1.5,0) -- ++(0,3) -- ++(-1.5,0); \fill[cyan, fill opacity=0.35] (6.5,0) circle (1.5); \end{scope} \end{tikzpicture} \begin{tikzpicture} \draw[fill=cyan] (0,0) rectangle (1,-1); \draw[gray,fill=cyan!40!white] (8,0) rectangle (9,-1); \draw[gray,fill=cyan!40!white] (0,-5) rectangle (1,-6); \draw[fill=cyan] (8,-5) rectangle (9,-6); \foreach \x in {90,89,...,-90} { % change 89 to 80 for speed % \elrad is the x-radius of the ellipse (technically, a circle seen % from side on at angle \x). The 'max' is because at small angles % then the real ellipse is too thin and the torus doesn't ``fill % out'' nicely. \pgfmathsetmacro\elrad{20*max(cos(\x),.1)} \pgfmathsetmacro\lscale{1-abs(\x-45)/180} \pgfmathsetmacro\rscale{abs(\x+45)/180} % We draw the torus from the back to the front to get the right % layering effect. To tint it, we define colours according to the % angle, but need different colours for the left and right pieces. % It'd be nice if the xcolor colour specification could take something % computed by pdfmath, such as {red!\tint} but it doesn't appear to % work, so we define the colours explicitly. \pgfmathsetmacro\ltint{.9*abs(\x-45)/180} \pgfmathsetmacro\rtint{.9*(1-abs(\x+45)/180)} \definecolor{currentcolor}{rgb}{\ltint, 0, \ltint} % This draws the right-hand circle. \draw[color=currentcolor,fill=currentcolor] (4.3cm,-.5cm) +(xyz polar cs:angle=\x,y radius=.75,x radius=1.5) ellipse (\elrad*\lscale pt and 20*\lscale pt); % This sets the colour correctly for the left-hand circle ... \definecolor{currentcolor}{rgb}{\rtint, 0, \rtint} % ... and draws it \draw[color=currentcolor,fill=currentcolor] (4.3cm,-.5cm) +(xyz polar cs:angle=180-\x,radius=.75,x radius=1.5) ellipse (\elrad*\rscale pt and 20*\rscale pt); % End of foreach statement } \shadedraw[shading=ball,ball color=red] (3,-5.5) .. controls (3.5,-5.5) and (4,-4.5) .. (4.5,-4.5) .. controls (5,-4.5) and (6,-5) .. (6,-5.5) .. controls (6,-6) and (5,-6.5) .. (4.5,-6.5) .. controls (4,-6.5) and (3.5, -5.5) .. (3,-5.5); \draw[->] (1.2,-0.5) -- node[auto=left] {\(\phi\)} (2.4,-0.5); \draw[->, color=gray] (1.2,-5.5) -- (2.4,-5.5); \draw[->, color=gray] (6.4,-0.5) -- (7.8,-0.5); \draw[->] (6.4,-5.5) -- node[auto=left] {\(\psi\)} (7.8,-5.5); \draw[->] (4.5,-1.8) -- node[auto=left] {\(f\)} (4.5,-4); \end{tikzpicture} \end{document}
\documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc,positioning,shadows.blur,decorations.pathreplacing} \usepackage{etoolbox} \tikzset{% brace/.style = { decorate, decoration={brace, amplitude=5pt} }, mbrace/.style = { decorate, decoration={brace, amplitude=5pt, mirror} }, label/.style = { black, midway, scale=0.5, align=center }, toplabel/.style = { label, above=.5em, anchor=south }, leftlabel/.style = { label,rotate=-90,left=.5em,anchor=north }, bottomlabel/.style = { label, below=.5em, anchor=north }, force/.style = { rotate=-90,scale=0.4 }, round/.style = { rounded corners=2mm }, legend/.style = { right,scale=0.4 }, nosep/.style = { inner sep=0pt }, generation/.style = { anchor=base } } \newcommand\particle[7][white]{% \begin{tikzpicture}[x=1cm, y=1cm] \path[fill=#1,blur shadow={shadow blur steps=5}] (0.1,0) -- (0.9,0) arc (90:0:1mm) -- (1.0,-0.9) arc (0:-90:1mm) -- (0.1,-1.0) arc (-90:-180:1mm) -- (0,-0.1) arc(180:90:1mm) -- cycle; \ifstrempty{#7}{}{\path[fill=purple!50!white] (0.6,0) --(0.7,0) -- (1.0,-0.3) -- (1.0,-0.4);} \ifstrempty{#6}{}{\path[fill=green!50!black!50] (0.7,0) -- (0.9,0) arc (90:0:1mm) -- (1.0,-0.3);} \ifstrempty{#5}{}{\path[fill=orange!50!white] (1.0,-0.7) -- (1.0,-0.9) arc (0:-90:1mm) -- (0.7,-1.0);} \draw[\ifstrempty{#2}{dashed}{black}] (0.1,0) -- (0.9,0) arc (90:0:1mm) -- (1.0,-0.9) arc (0:-90:1mm) -- (0.1,-1.0) arc (-90:-180:1mm) -- (0,-0.1) arc(180:90:1mm) -- cycle; \ifstrempty{#7}{}{\node at(0.825,-0.175) [rotate=-45,scale=0.2] {#7};} \ifstrempty{#6}{}{\node at(0.9,-0.1) [nosep,scale=0.17] {#6};} \ifstrempty{#5}{}{\node at(0.9,-0.9) [nosep,scale=0.2] {#5};} \ifstrempty{#4}{}{\node at(0.1,-0.1) [nosep,anchor=west,scale=0.25]{#4};} \ifstrempty{#3}{}{\node at(0.1,-0.85) [nosep,anchor=west,scale=0.3] {#3};} \ifstrempty{#2}{}{\node at(0.1,-0.5) [nosep,anchor=west,scale=1.5] {#2};} \end{tikzpicture} } \begin{document} \begin{tikzpicture}[x=1.2cm, y=1.2cm] \draw[round] (-0.5,0.5) rectangle (4.4,-1.5); \draw[round] (-0.6,0.6) rectangle (5.0,-2.5); \draw[round] (-0.7,0.7) rectangle (5.6,-3.5); \node at(0, 0) {\particle[gray!20!white] {$u$} {up} {$2.3$ MeV}{1/2}{$2/3$}{R/G/B}}; \node at(0,-1) {\particle[gray!20!white] {$d$} {down} {$4.8$ MeV}{1/2}{$-1/3$}{R/G/B}}; \node at(0,-2) {\particle[gray!20!white] {$e$} {electron} {$511$ keV}{1/2}{$-1$}{}}; \node at(0,-3) {\particle[gray!20!white] {$\nu_e$} {$e$ neutrino} {$<2$ eV}{1/2}{}{}}; \node at(1, 0) {\particle {$c$} {charm} {$1.28$ GeV}{1/2}{$2/3$}{R/G/B}}; \node at(1,-1) {\particle {$s$} {strange} {$95$ MeV}{1/2}{$-1/3$}{R/G/B}}; \node at(1,-2) {\particle {$\mu$} {muon} {$105.7$ MeV}{1/2}{$-1$}{}}; \node at(1,-3) {\particle {$\nu_\mu$} {$\mu$ neutrino} {$<190$ keV}{1/2}{}{}}; \node at(2, 0) {\particle {$t$} {top} {$173.2$ GeV}{1/2}{$2/3$}{R/G/B}}; \node at(2,-1) {\particle {$b$} {bottom} {$4.7$ GeV}{1/2}{$-1/3$}{R/G/B}}; \node at(2,-2) {\particle {$\tau$} {tau} {$1.777$ GeV}{1/2}{$-1$}{}}; \node at(2,-3) {\particle {$\nu_\tau$} {$\tau$ neutrino} {$<18.2$ MeV}{1/2}{}{}}; \node at(3,-3) {\particle[orange!20!white] {$W^{\hspace{-.3ex}\scalebox{.5}{$\pm$}}$} {} {$80.4$ GeV}{1}{$\pm1$}{}}; \node at(4,-3) {\particle[orange!20!white] {$Z$} {} {$91.2$ GeV}{1}{}{}}; \node at(3.5,-2) {\particle[green!50!black!20] {$\gamma$} {photon} {}{1}{}{}}; \node at(3.5,-1) {\particle[purple!20!white] {$g$} {gluon} {}{1}{}{color}}; \node at(5,0) {\particle[gray!50!white] {$H$} {Higgs} {$125.1$ GeV}{0}{}{}}; \node at(6.1,-3) {\particle {} {graviton} {}{}{}{}}; \node at(4.25,-0.5) [force] {strong nuclear force (color)}; \node at(4.85,-1.5) [force] {electromagnetic force (charge)}; \node at(5.45,-2.4) [force] {weak nuclear force (weak isospin)}; \node at(6.75,-2.5) [force] {gravitational force (mass)}; \draw [<-] (2.5,0.3) -- (2.7,0.3) node [legend] {charge}; \draw [<-] (2.5,0.15) -- (2.7,0.15) node [legend] {colors}; \draw [<-] (2.05,0.25) -- (2.3,0) -- (2.7,0) node [legend] {mass}; \draw [<-] (2.5,-0.3) -- (2.7,-0.3) node [legend] {spin}; \draw [mbrace] (-0.8,0.5) -- (-0.8,-1.5) node[leftlabel] {6 quarks\\(+6 anti-quarks)}; \draw [mbrace] (-0.8,-1.5) -- (-0.8,-3.5) node[leftlabel] {6 leptons\\(+6 anti-leptons)}; \draw [mbrace] (-0.5,-3.6) -- (2.5,-3.6) node[bottomlabel] {12 fermions\\(+12 anti-fermions)\\increasing mass $\to$}; \draw [mbrace] (2.5,-3.6) -- (5.5,-3.6) node[bottomlabel] {5 bosons\\(+1 opposite charge $W$)}; \draw [brace] (-0.5,.8) -- (0.5,.8) node[toplabel] {standard matter}; \draw [brace] (0.5,.8) -- (2.5,.8) node[toplabel] {unstable matter}; \draw [brace] (2.5,.8) -- (4.5,.8) node[toplabel] {force carriers}; \draw [brace] (4.5,.8) -- (5.5,.8) node[toplabel] {Goldstone\\bosons}; \draw [brace] (5.5,.8) -- (7,.8) node[toplabel] {outside\\standard model}; \node at (0,1.2) [generation] {1\tiny st}; \node at (1,1.2) [generation] {2\tiny nd}; \node at (2,1.2) [generation] {3\tiny rd}; \node at (2.8,1.2) [generation] {\tiny generation}; \end{tikzpicture} \end{document}
\documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} %% helper macros % The 3D code is based on The drawing is based on Tomas M. Trzeciak's % `Stereographic and cylindrical map projections example`: % http://www.texample.net/tikz/examples/map-projections/ \newcommand\pgfmathsinandcos[3]{% \pgfmathsetmacro#1{sin(#3)}% \pgfmathsetmacro#2{cos(#3)}% } \newcommand\LongitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % azimuth \tikzset{#1/.estyle={cm={\cost,\sint*\sinEl,0,\cosEl,(0,0)}}} } \newcommand\LatitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % latitude \pgfmathsetmacro\yshift{\cosEl*\sint} \tikzset{#1/.estyle={cm={\cost,0,0,\cost*\sinEl,(0,\yshift)}}} % } \newcommand\DrawLongitudeCircle[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,thin,black] (\angVis:1) arc (\angVis:\angVis+180:1); \draw[current plane,thin,dashed] (\angVis-180:1) arc (\angVis-180:\angVis:1); }%this is fake: for drawing the grid \newcommand\DrawLongitudeCirclered[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,red,thick] (150:1) arc (150:180:1); %\draw[current plane,dashed] (-50:1) arc (-50:-35:1); }%for drawing the grid \newcommand\DLongredd[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,black,dashed, ultra thick] (150:1) arc (150:180:1); } \newcommand\DLatred[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} \draw[current plane,dashed,black,ultra thick] (-50:1) arc (-50:-35:1); } \newcommand\fillred[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane,red,thin] (\angVis:1) arc (\angVis:\angVis+180:1); } \newcommand\DrawLatitudeCircle[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} \draw[current plane,thin,black] (\angVis:1) arc (\angVis:-\angVis-180:1); \draw[current plane,thin,dashed] (180-\angVis:1) arc (180-\angVis:\angVis:1); }%Defining functions to draw limited latitude circles (for the red mesh) \newcommand\DrawLatitudeCirclered[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} %\draw[current plane,red,thick] (-\angVis-50:1) arc (-\angVis-50:-\angVis-20:1); \draw[current plane,red,thick] (-50:1) arc (-50:-35:1); } \tikzset{% >=latex, inner sep=0pt,% outer sep=2pt,% mark coordinate/.style={inner sep=0pt,outer sep=0pt,minimum size=3pt, fill=black,circle}% } \usepackage{amsmath} \usetikzlibrary{arrows} \pagestyle{empty} \usepackage{pgfplots} \usetikzlibrary{calc,fadings,decorations.pathreplacing} \begin{document} \begin{figure}[ht!] \begin{tikzpicture}[scale=1,every node/.style={minimum size=1cm}] %% some definitions \def\R{4} % sphere radius \def\angEl{25} % elevation angle \def\angAz{-100} % azimuth angle \def\angPhiOne{-50} % longitude of point P \def\angPhiTwo{-35} % longitude of point Q \def\angBeta{30} % latitude of point P and Q %% working planes \pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole \LongitudePlane[xzplane]{\angEl}{\angAz} \LongitudePlane[pzplane]{\angEl}{\angPhiOne} \LongitudePlane[qzplane]{\angEl}{\angPhiTwo} \LatitudePlane[equator]{\angEl}{0} \fill[ball color=white!10] (0,0) circle (\R); % 3D lighting effect \coordinate (O) at (0,0); \coordinate[mark coordinate] (N) at (0,\H); \coordinate[mark coordinate] (S) at (0,-\H); \path[xzplane] (\R,0) coordinate (XE); %defining points outsided the area bounded by the sphere \path[qzplane] (\angBeta:\R+5.2376) coordinate (XEd); \path[pzplane] (\angBeta:\R) coordinate (P);%fino alla sfera \path[pzplane] (\angBeta:\R+5.2376) coordinate (Pd);%sfora di una quantità pari a 10 dopo la sfera \path[pzplane] (\angBeta:\R+5.2376) coordinate (Td);%sfora di una quantità pari a 10 dopo la sfera \path[pzplane] (\R,0) coordinate (PE); \path[pzplane] (\R+4,0) coordinate (PEd); \path[qzplane] (\angBeta:\R) coordinate (Q); \path[qzplane] (\angBeta:\R) coordinate (Qd);%sfora di una quantità pari a 10 dopo la sfera \path[qzplane] (\R,0) coordinate (QE); \path[qzplane] (\R+4,0) coordinate (QEd);%sfora di una quantità 10 dalla sfera sul piano equat. \DrawLongitudeCircle[\R]{\angPhiOne} % pzplane \DrawLongitudeCircle[\R]{\angPhiTwo} % qzplane \DrawLatitudeCircle[\R]{\angBeta} \DrawLatitudeCircle[\R]{0} % equator %labelling north and south \node[above=8pt] at (N) {$\mathbf{N}$}; \node[below=8pt] at (S) {$\mathbf{S}$}; \draw[-,dashed, thick] (N) -- (S); \draw[->] (O) -- (P); \draw[dashed] (XE) -- (O) -- (PE); \draw[dashed] (O) -- (QE); %connecting Points outside the sphere \draw[-,dashed,black,very thick] (O) -- (Pd); \draw[-,dashed,black,very thick] (O) -- (PEd); \draw[-,dashed,black,very thick] (O) -- (QEd); \draw[-,dashed,black,very thick] (O) -- (XEd); \draw[dashed] (XE) -- (O) -- (PE); %draw black thick flat grid \draw[-,ultra thick,black] (Pd) -- (PEd) node[below, left] {$P_1$};%verticale sinistro \draw[-,ultra thick,black] (PEd) -- (QEd)node[below, right] {$P_3$};%orizzontale inferiore \draw[-,ultra thick,black] (Pd)-- (XEd)node[above, right] {$P_2$};%orizzontale superiore \draw[-,ultra thick,black] (XEd) -- (QEd); \draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15] node[midway,right] {$\lambda$} (\angBeta:0.5*\R); \path[pzplane] (0.5*\angBeta:\R) node[right] {$$}; \path[qzplane] (0.5*\angBeta:\R) node[right] {$$}; \draw[equator,->,thin] (\angAz:0.5*\R) to[bend right=30] node[pos=0.4,above] {$\phi_1$} (\angPhiOne:0.5*\R); \draw[equator,->,thin] (\angAz:0.6*\R) to[bend right=35] node[midway,below] {$\phi_2$} (\angPhiTwo:0.6*\R); \path[xzplane] (0:\R) node[below] {$$}; \path[xzplane] (\angBeta:\R) node[below left] {$$}; \foreach \t in {0,2,...,30} { \DrawLatitudeCirclered[\R]{\t} } \foreach \t in {130,133,...,145} { \DrawLongitudeCirclered[\R]{\t} } %drawing grids on the spere invoking DLongredd and DrawLongitudeCirclered \foreach \t in {130,145,...,145} { \DLongredd[\R+3]{\t} } \foreach \t in {130,133,...,145} { \DrawLongitudeCirclered[\R+3]{\t} } \foreach \t in {0,30,...,30} { \DLatred[\R+3]{\t} } \foreach \t in {0,2,...,30} { \DrawLatitudeCirclered[\R+3]{\t} } %labelling \draw[-latex,thick](4,-5.5)node[left]{$\mathsf{Grid(s)\ in\ Fig. \ (\ref{fig:Grid})}$} to[out=0,in=270] (5.8,-2.3); \draw[thick](3.6,-6)node[left]{$[\mathsf{Rectilinear}]$}; \end{tikzpicture} \caption[Representation of spherical and regular computational grids used by SWAN] {Representation of spherical (red) and cartesian (black) co-ordinate systems. Latter gives an example of unstructured grids. Both unstructured. Conversion from former to latter involves a deformation factor which is acceptable within a given spatial limit. For my case, only unstructured flat meshes are employed (\textit{Lisboa} Geodetic datum: black grid on the right). Confront above represented points ($P_1,P_2,P_3$) with Fig.(\ref{fig:Grid}). \\Mathematically frames change accordingly: see Eq.(\ref{eq:actbal2sph}).} \label{fig:frames} \end{figure} \end{document}
\documentclass{article} \usepackage{tikz} %\usepackage{pgfmath} \usetikzlibrary{calc} \usepackage{animate} \usepackage{fp} %[fr] utile pour les calculs de position des différentes phases du moteur % [fr] mais inutile pour la simulation seule % Useful for calculating the position of the different phases of the motor but useless for simulation only \newcommand{\Wankel}[1]{ % \def\itheta{#1} \FPabs{\itheta}{#1} % définition des données \ data definition \def\OA{0.4} \def\OB{0.8} \def\AE{4} % \def\seuil{500} % \def\couleur{20} %========== % [fr] définition des paramètres angulaires du rotor en fonction des phases du moteur % definition of angular parameters of the rotor according to the motor phases \def\Comp{0} \def\Expl{360} \def\Det{375} \def\Ech{660} \def\Asp{870} \def\decalage{125} % [fr] décalage de l'origine pour positionner le rotor au début de la compression à l'instant t=0 % [en] shift the origin to position the rotor at the start of compression at time t = 0 \begin{tikzpicture} %===== [fr] Définition de quelques couleurs pales\ [en] some color \colorlet{vertclair}{green!25} \colorlet{grisclair}{gray!60} \colorlet{rougepale}{red!60} % [fr] Début des test nécessaire pour colorer la chambre % test needed to color the combustion chamber \FPabs{\val}{\itheta} % [fr] FPiflt et les autres tests de FP ne permettent pas de faire des % [fr] tests inclus dans des tests. Le premier test est donc toujours vrai, % [fr] le style chambre1 sera donc affecté avec [{vertclair!\pos!orange}] % [fr] mais ne sera affiché que si aucun des tests suivants n'est vrai. % FPiflt and other FP tests do not do tests included in the tests. The first % test is always true, the style will be affected with chambre1 % [{vertclair! \ Pos! Orange}] but will not be displayed if any of the % following tests is true. \FPiflt{\val}{1080} \FPeval{\pos}{(\val-1080)/(\Ech-1080)*100} \tikzstyle{chambre1}=[{vertclair!\pos!orange}]% aspiration % \tikzstyle{chambre2}=[ ball color={gray!\pos!red}]% détente} % \tikzstyle{chambre3}=[ ball color={orange!\pos!green}]% aspiration \def\texte{Aspiration} \fi % [fr] echappement / Second test, Exhaust \FPiflt{\val}{\Asp} \FPeval{\pos}{(\val-\Ech)/(\Asp-\Ech)*100} \tikzstyle{chambre1}=[{vertclair!\pos!grisclair}]%echappement % \tikzstyle{chambre2}=[ ball color={gray!\pos!red}]% détente} % \tikzstyle{chambre3}=[ ball color={orange!\pos!green}]%aspiration \def\texte{Echappement} \fi % [fr] troisième test - détente / Third test - relaxation \FPiflt{\val}{\Ech} \FPeval{\pos}{(\val-\Det)/(\Ech-\Det)*100} \tikzstyle{chambre1}=[ {grisclair!\pos!rougepale}]%détente} % \tikzstyle{chambre2}=[ ball color={gray!\pos!red}]%compression % \tikzstyle{chambre3}=[ ball color={orange!\pos!green}]%aspiration \def\texte{Detente} \fi % [fr] quatrième test - explosion / Fourth test - explosion \FPiflt{\val}{\Det} \FPeval{\pos}{(\val-\Expl)/(\Det-\Expl)*100} \tikzstyle{chambre1}=[ {rougepale!\pos!red}]%Explosion % \tikzstyle{chambre2}=[ ball color={gray!\pos!red}]%détente} % \tikzstyle{chambre3}=[ ball color={orange!\pos!green}]%aspiration \def\texte{Explosion} \fi % [fr] cinquième test / Fifth test - aspiration \FPiflt{\val}{\Expl} \FPeval{\pos}{(\val-\Comp)/(\Expl-\Comp)*100} \tikzstyle{chambre1}=[ {red!\pos!orange}]%compression % \tikzstyle{chambre2}=[ ball color={gray!\pos!red}]%détente} % \tikzstyle{chambre3}=[ ball color={orange!\pos!green}]%aspiration \def\texte{Compression} \fi \FPtrunc{\pos}{\pos}{0} % [fr] Ajout du décalage pour dessiner le rotor en position initiale % [en] Adding the offset to draw the rotor in the first position \FPeval{\itheta}{0-(\decalage+\itheta)} % [fr] début du dessin \draw (-5,-4.5) rectangle (5,4.5); %cadre pour imposer les dimensions du dessin %[fr}dessin du stator / drawing of the stator \begin{scope}% stator \coordinate (A) at (\itheta:\OA); %[fr] Le point A tourne autour de O % [fr] avec l'angle itheta % [en]Point A turns around point O the angle with itheta \coordinate (O) at (0,0);% Origine \filldraw[thick,black,domain=0:1080,smooth,variable=\t,fill=gray,samples=50] plot ({.4*cos(\t)+4*cos(.333333*\t)},{.4*sin(\t)+4*sin(.333333*\t)}) plot ({.42*cos(-\t)+4.2*cos(-.333333*\t)},{.42*sin(-\t)+4.2*sin(-.333333*\t)}); \fill[white](0.3,3) rectangle (0.5,4); % dessin des soupapes % (admission echappement) \fill[white](-0.3,3) rectangle (-0.5,4); \filldraw[red](-0.4,-3.5) rectangle (-0.5,-3.7);% Bougie % [fr]Coloriage des chambres en fonction de la phase de fonctionnement, % [fr]le rotor sera dessine par dessus et masquera le surplus % [fr](le bord intérieur est linéaire et non incurvé). % Coloring of the rooms according to the operating phase, the rotor will be % plotted on top and hide the rest (the inner edge is straight, not curved). % Chambre 1 \fill[thick,black,domain=-1*(\itheta):-1*(\itheta+360),smooth,variable=\t, chambre1] plot ({.4*cos(-\t)+4*cos(-.333333*\t)}, {.4*sin(-\t)+4*sin(-.333333*\t)}); % affichage des paramètres % \FPtrunc{\itheta}{\itheta}{0} % \FPtrunc{\val}{\val}{0} % \node at (0,6){$\theta$=\itheta,pos=\pos,val=\val}; \draw[black](O) circle (\OB); %Dessin du pignon fixe \draw(O) -- (A); \end{scope} % [fr] Dessin du rotor / Draw the rotor \begin{scope}[shift={(A)},rotate={\itheta}] % le repere est tourné de itheta % [fr] les trois points, C, D, E sont définis en polaire dans ce repère % [en] the three points, C, D, E are defined in the polar reference \coordinate (E) at ({-\itheta*\OB/(\OB+\OA)}:\AE); \coordinate (C) at ({-\itheta*\OB/(\OB+\OA)+120}:\AE); \coordinate (D) at ({-\itheta*\OB/(\OB+\OA)+240}:\AE); \draw[red](A) -- (E); \filldraw [bend left=29.5,red,fill=red!50] (A) circle (\OA+\OB)% dessin et coloriage du rotor (E) to (D) to (C) to (E); \end{scope} \node at (0,-4) {\texte}; % le texte affiche la phase de fonctionnement \end{tikzpicture} } \begin{document} % [fr] Animation avec le package animate % Animation with the animate package \begin{animateinline}[controls,loop]{12} \multiframe{72}{ixb=0+15}{ \Wankel{\ixb}} \end{animateinline} \vfill %{fr] Pour dessiner le rotor dans un position particulière % To draw the rotor in a particular position \begin{center} \Wankel{200} \end{center} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,fadings,decorations.pathreplacing} %% helper macros \newcommand\pgfmathsinandcos[3]{% \pgfmathsetmacro#1{sin(#3)}% \pgfmathsetmacro#2{cos(#3)}% } \newcommand\LongitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % azimuth \tikzset{#1/.style={cm={\cost,\sint*\sinEl,0,\cosEl,(0,0)}}} } \newcommand\LatitudePlane[3][current plane]{% \pgfmathsinandcos\sinEl\cosEl{#2} % elevation \pgfmathsinandcos\sint\cost{#3} % latitude \pgfmathsetmacro\yshift{\cosEl*\sint} \tikzset{#1/.style={cm={\cost,0,0,\cost*\sinEl,(0,\yshift)}}} % } \newcommand\DrawLongitudeCircle[2][1]{ \LongitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} % angle of "visibility" \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} % \draw[current plane] (\angVis:1) arc (\angVis:\angVis+180:1); \draw[current plane,dashed] (\angVis-180:1) arc (\angVis-180:\angVis:1); } \newcommand\DrawLatitudeCircle[2][1]{ \LatitudePlane{\angEl}{#2} \tikzset{current plane/.prefix style={scale=#1}} \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)} % angle of "visibility" \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))} \draw[current plane] (\angVis:1) arc (\angVis:-\angVis-180:1); \draw[current plane,dashed] (180-\angVis:1) arc (180-\angVis:\angVis:1); } %% document-wide tikz options and styles \tikzset{% >=latex, % option for nice arrows inner sep=0pt,% outer sep=2pt,% mark coordinate/.style={inner sep=0pt,outer sep=0pt,minimum size=3pt, fill=black,circle}% } \begin{document} \begin{tikzpicture} % "THE GLOBE" showcase \def\R{2.5} % sphere radius \def\angEl{35} % elevation angle \filldraw[ball color=white] (0,0) circle (\R); \foreach \t in {-80,-60,...,80} { \DrawLatitudeCircle[\R]{\t} } \foreach \t in {-5,-35,...,-175} { \DrawLongitudeCircle[\R]{\t} } \end{tikzpicture} \begin{tikzpicture} % CENT %% some definitions \def\R{2.5} % sphere radius \def\angEl{35} % elevation angle \def\angAz{-105} % azimuth angle \def\angPhi{-40} % longitude of point P \def\angBeta{19} % latitude of point P %% working planes \pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole \tikzset{xyplane/.style={cm={cos(\angAz),sin(\angAz)*sin(\angEl),-sin(\angAz), cos(\angAz)*sin(\angEl),(0,-\H)}}} \LongitudePlane[xzplane]{\angEl}{\angAz} \LongitudePlane[pzplane]{\angEl}{\angPhi} \LatitudePlane[equator]{\angEl}{0} %% draw xyplane and sphere \draw[xyplane] (-2*\R,-2*\R) rectangle (2.2*\R,2.8*\R); \fill[ball color=white] (0,0) circle (\R); % 3D lighting effect \draw (0,0) circle (\R); %% characteristic points \coordinate (O) at (0,0); \coordinate[mark coordinate] (N) at (0,\H); \coordinate[mark coordinate] (S) at (0,-\H); \path[pzplane] (\angBeta:\R) coordinate[mark coordinate] (P); \path[pzplane] (\R,0) coordinate (PE); \path[xzplane] (\R,0) coordinate (XE); \path (PE) ++(0,-\H) coordinate (Paux); % to aid Phat calculation \coordinate[mark coordinate] (Phat) at (intersection cs: first line={(N)--(P)}, second line={(S)--(Paux)}); %% draw meridians and latitude circles \DrawLatitudeCircle[\R]{0} % equator %\DrawLatitudeCircle[\R]{\angBeta} \DrawLongitudeCircle[\R]{\angAz} % xzplane \DrawLongitudeCircle[\R]{\angAz+90} % yzplane \DrawLongitudeCircle[\R]{\angPhi} % pzplane %% draw xyz coordinate system \draw[xyplane,<->] (1.8*\R,0) node[below] {$x,\xi$} -- (0,0) -- (0,2.4*\R) node[right] {$y,\eta$}; \draw[->] (0,-\H) -- (0,1.6*\R) node[above] {$z,\zeta$}; %% draw lines and put labels \draw[dashed] (P) -- (N) +(0.3ex,0.6ex) node[above left] {$\mathbf{N}$}; \draw (P) -- (Phat) node[above right] {$\mathbf{\hat{P}}$}; \path (S) +(0.4ex,-0.4ex) node[below] {$\mathbf{S}$}; \draw[->] (O) -- (P) node[above right] {$\mathbf{P}$}; \draw[dashed] (XE) -- (O) -- (PE); \draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15] node[pos=0.4,right] {$\beta$} (\angBeta:0.5*\R); \draw[equator,->,thin] (\angAz:0.4*\R) to[bend right=30] node[pos=0.4,below] {$\phi$} (\angPhi:0.4*\R); \draw[thin,decorate,decoration={brace,raise=0.5pt,amplitude=1ex}] (N) -- (O) node[midway,right=1ex] {$a$}; \end{tikzpicture} \begin{tikzpicture} % MERC %% some definitions \def\R{3} % sphere radius \def\angEl{25} % elevation angle \def\angAz{-100} % azimuth angle \def\angPhiOne{-50} % longitude of point P \def\angPhiTwo{-35} % longitude of point Q \def\angBeta{33} % latitude of point P and Q %% working planes \pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole \LongitudePlane[xzplane]{\angEl}{\angAz} \LongitudePlane[pzplane]{\angEl}{\angPhiOne} \LongitudePlane[qzplane]{\angEl}{\angPhiTwo} \LatitudePlane[equator]{\angEl}{0} %% draw background sphere \fill[ball color=white] (0,0) circle (\R); % 3D lighting effect %\fill[white] (0,0) circle (\R); % just a white circle \draw (0,0) circle (\R); %% characteristic points \coordinate (O) at (0,0); \coordinate[mark coordinate] (N) at (0,\H); \coordinate[mark coordinate] (S) at (0,-\H); \path[xzplane] (\R,0) coordinate (XE); \path[pzplane] (\angBeta:\R) coordinate (P); \path[pzplane] (\R,0) coordinate (PE); \path[qzplane] (\angBeta:\R) coordinate (Q); \path[qzplane] (\R,0) coordinate (QE); %% meridians and latitude circles % \DrawLongitudeCircle[\R]{\angAz} % xzplane % \DrawLongitudeCircle[\R]{\angAz+90} % yzplane \DrawLongitudeCircle[\R]{\angPhiOne} % pzplane \DrawLongitudeCircle[\R]{\angPhiTwo} % qzplane \DrawLatitudeCircle[\R]{\angBeta} \DrawLatitudeCircle[\R]{0} % equator % shifted equator in node with nested call to tikz % (I didn't know it's possible) \node at (0,1.6*\R) { \tikz{\DrawLatitudeCircle[\R]{0}} }; %% draw lines and put labels \draw (-\R,-\H) -- (-\R,2*\R) (\R,-\H) -- (\R,2*\R); \draw[->] (XE) -- +(0,2*\R) node[above] {$y$}; \node[above=8pt] at (N) {$\mathbf{N}$}; \node[below=8pt] at (S) {$\mathbf{S}$}; \draw[->] (O) -- (P); \draw[dashed] (XE) -- (O) -- (PE); \draw[dashed] (O) -- (QE); \draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15] node[midway,right] {$\beta$} (\angBeta:0.5*\R); \path[pzplane] (0.5*\angBeta:\R) node[right] {$\hat{1}$}; \path[qzplane] (0.5*\angBeta:\R) node[right] {$\hat{2}$}; \draw[equator,->,thin] (\angAz:0.5*\R) to[bend right=30] node[pos=0.4,above] {$\phi_1$} (\angPhiOne:0.5*\R); \draw[equator,->,thin] (\angAz:0.6*\R) to[bend right=35] node[midway,below] {$\phi_2$} (\angPhiTwo:0.6*\R); \draw[equator,->] (-90:\R) arc (-90:-70:\R) node[below=0.3ex] {$x = a\phi$}; \path[xzplane] (0:\R) node[below] {$\beta=0$}; \path[xzplane] (\angBeta:\R) node[below left] {$\beta=\beta_0$}; \end{tikzpicture} \begin{tikzpicture} % KART \def\R{2.5} \node[draw,minimum size=2cm*\R,inner sep=0,outer sep=0,circle] (C) at (0,0) {}; \coordinate (O) at (0,0); \coordinate[mark coordinate] (Phat) at (20:2.5*\R); \coordinate (T1) at (tangent cs: node=C, point={(Phat)}, solution=1); \coordinate (T2) at (tangent cs: node=C, point={(Phat)}, solution=2); \coordinate[mark coordinate] (P) at ($(T1)!0.5!(T2)$); \draw[dashed] (T1) -- (O) -- (T2) -- (Phat) -- (T1) -- (T2); \draw[<->] (0,1.5*\R) node[above] {$y$} |- (2.5*\R,0) node[right] {$x$}; \draw (O) node[below left] {$\mathbf{O}$} -- (P) +(1ex,0) node[above=1ex] {$\mathbf{P}$}; \draw (P) -- (Phat) node[above=1ex] {$\mathbf{\hat{P}}$}; \end{tikzpicture} \end{document}
\documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows,shadows} \usepackage{amsmath,bm,times} \newcommand{\mx}[1]{\mathbf{\bm{#1}}} % Matrix command \newcommand{\vc}[1]{\mathbf{\bm{#1}}} % Vector command \begin{document} % Define the layers to draw the diagram \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} % Define block styles used later \tikzstyle{sensor}=[draw, fill=blue!20, text width=5em, text centered, minimum height=2.5em,drop shadow] \tikzstyle{ann} = [above, text width=5em, text centered] \tikzstyle{wa} = [sensor, text width=10em, fill=red!20, minimum height=6em, rounded corners, drop shadow] \tikzstyle{sc} = [sensor, text width=13em, fill=red!20, minimum height=10em, rounded corners, drop shadow] % Define distances for bordering \def\blockdist{2.3} \def\edgedist{2.5} \begin{tikzpicture} \node (wa) [wa] {System Combination}; \path (wa.west)+(-3.2,1.5) node (asr1) [sensor] {$ASR_1$}; \path (wa.west)+(-3.2,0.5) node (asr2)[sensor] {$ASR_2$}; \path (wa.west)+(-3.2,-1.0) node (dots)[ann] {$\vdots$}; \path (wa.west)+(-3.2,-2.0) node (asr3)[sensor] {$ASR_N$}; \path (wa.east)+(\blockdist,0) node (vote) [sensor] {$\theta_0,\theta_1,...,\theta_M$\\Estimated Parameters}; \path [draw, ->] (asr1.east) -- node [above] {} (wa.160) ; \path [draw, ->] (asr2.east) -- node [above] {} (wa.180); \path [draw, ->] (asr3.east) -- node [above] {} (wa.200); \path [draw, ->] (wa.east) -- node [above] {} (vote.west); \path (wa.south) +(0,-\blockdist) node (asrs) {System Combination - Training}; \begin{pgfonlayer}{background} \path (asr1.west |- asr1.north)+(-0.5,0.3) node (a) {}; \path (wa.south -| wa.east)+(+0.5,-0.3) node (b) {}; \path (vote.east |- asrs.east)+(+0.5,-0.5) node (c) {}; \path[fill=yellow!20,rounded corners, draw=black!50, dashed] (a) rectangle (c); \path (asr1.north west)+(-0.2,0.2) node (a) {}; \end{pgfonlayer} % Validation Layer is the same except that there are a set of nodes and links which are added \path (wa.south)+(-2.0,-7.5) node (syscomb) [sc] {\textbf{System Combination \\Algorithm}\\Estimated Parameters\\from training}; \path (syscomb.west)+(-2.2,1.5) node (asrt1) [sensor] {$ASR_1$}; \path (syscomb.west)+(-2.2,0.5) node (asrt2)[sensor] {$ASR_2$}; \path (syscomb.west)+(-2.2,-1.0) node (dots)[ann] {$\vdots$}; \path (syscomb.west)+(-2.2,-2.0) node (asrt3)[sensor] {$ASR_N$}; \path [draw, ->] (asrt1.east) -- node [above] {} (syscomb.160) ; \path [draw, ->] (asrt2.east) -- node [above] {} (syscomb.180); \path [draw, ->] (asrt3.east) -- node [above] {} (syscomb.200); \path (wa.south) +(0,-\blockdist) node (sct) {System Combination - Training}; \path (syscomb.east)+(1.0,0.0) node (bwtn) {}; % Note how the single nodes are repeated using for loop \foreach \x in {0,1,...,4} { \draw (bwtn.east)+(\x,0) node (asr\x-2)[]{}; \fill (bwtn.east)+(\x,0) circle (0.1cm); } \path [draw, ->] (syscomb.east) -- node [above] {} (bwtn.east); \path [draw, ->] (asr0-2) -- node [above] {@} (asr1-2); \path [draw, -] (asr1-2) -- node [above] {b} (asr2-2); \path [draw, -] (asr2-2) -- node [above] {z} (asr3-2); \path [draw, -] (asr3-2) -- node [above] {} (asr4-2); \path [draw, ->] (asr0-2) edge[bend right] node [below] {@} (asr1-2); \path [draw, ->] (asr1-2) edge[bend right] node [below] {b} (asr2-2); \path [draw, ->] (asr2-2) edge[bend right] node [below] {c} (asr3-2); \path [draw, ->] (asr4-2) node[]{} (asr4-2)+(1.0,0); \begin{scope}[looseness=1.6] \path [draw, ->] (asr0-2) edge[bend right=90] node [below] {a} (asr1-2); \path [draw, ->] (asr1-2) edge[bend right=90] node [below] {b} (asr2-2); \path [draw, ->] (asr2-2) edge[bend right=90] node [below] {c} (asr3-2); \end{scope} \path (asr3-2.east)+(1.5,0.0) node (bw)[sensor] {Best Word Sequence\\$\arg\max$}; \path [draw, -] (asr1-2.east) node [below] {} (bw.west); \begin{pgfonlayer}{background} \path (asrt1.west)+(-0.5,1.0) node (g) {}; \path (bw.east |- syscomb.south)+(0.5,-1.5) node (h) {}; \path[fill=yellow!20,rounded corners, draw=black!50, dashed] (g) rectangle (h); \path [draw, ->] (vote.south) edge[bend left=90] node [below] {Used in validation} (syscomb.30); \end{pgfonlayer} \path (asr1-2.south) +(-\blockdist,-\blockdist) node (asrs) {System Combination - Validation}; \end{tikzpicture} \end{document}
\documentclass[a4paper,12pt,oneside]{article} \usepackage{tikz} \begin{document} \def\scl{0.6}%scaling factor of the picture \begin{tikzpicture}[ scale=\scl, controlpanels/.style={yellow!30!brown!20!,rounded corners,draw=black,thick}, screen/.style={green!50!black!60!,draw=black,thick}, trace/.style={green!60!yellow!40!, ultra thick}, smallbutton/.style={white,draw=black, thick}, axes/.style={thick}] \fill[green!30!blue!30!,rounded corners,draw=black,thick](0,0) rectangle (27.75,13.25); \fill[fill=black!40!,draw=black,thick,rounded corners](0.25,0.25) rectangle (27.5,13.00); % Screen, centered around the origin then shifted for easy plotting \begin{scope}[xshift=7cm,yshift=8cm,samples=150] \fill[black!60!,rounded corners,draw=black,thick](-5.3,-4.3) rectangle (5.3,4.3); \fill[screen] (-5.0,-4.0) rectangle (5.0,4.0); \draw[trace] plot(\x,{1+2.4*sin((2.5*\x +1) r)}); % r for radians... \draw[trace] plot(\x,{-1+1.25*sin((0.75*\x) r}); \draw[thin] (-5.0,-4.0) grid (5.0,4.0); \draw[axes] (-5,0)--(5,0); % Time axis \draw[axes] (0,-4)--(0,4); \foreach \i in {-4.8,-4.6,...,4.8} \draw (\i,-0.1)--(\i,0.1); \foreach \i in {-3.8,-3.6,...,3.8} \draw (-0.1,\i)--(0.1,\i); \end{scope} % Feet \fill[black!70!,rounded corners,xshift=2cm] (0,-.5) rectangle (2,0); \fill[black!70!,rounded corners,xshift=23.75cm] (0,-.5) rectangle (2,0); % Lower left panel \fill[controlpanels] (0.6,0.5) rectangle (13.5,3.0); \path (0.8,0.9) node[scale=\scl,right]{$\mathbf{TeXtronics\,1 - v.1.01}$}; % Lower right panel \fill[controlpanels] (13.7,0.5) rectangle (27.1,6.2); %Channels % CH I \draw[thick] (14.8,1.5) circle (0.7cm); \fill[gray,draw=black,thick] (14.8,1.5) circle (0.5cm); \fill[white,draw=black,thick] (14.8,1.5) circle (0.3cm); \node[scale={1.5*\scl}] at (14.8,2.5) {CH I}; \draw[thick] (16.2,1.5) circle (0.4cm); \fill[black!60!] (16.2,1.5) circle (0.3cm); \draw[thick] (16.6,1.5) --(17,1.5)--(17,1.0); \draw[thick] (16.7,1.0)--(17.3,1.0); \draw[thick] (16.8,0.85)--(17.2,0.85); \draw[thick] (16.9,0.70)--(17.1,0.70); \draw[thick] (26.0,1.5) circle (0.7cm); % CH II \fill[gray,draw=black,thick] (26,1.5) circle (0.5cm); \fill[white,draw=black,thick] (26,1.5) circle (0.3cm); \node[scale={1.5*\scl}] at (26,2.5) {CH II}; \draw[thick] (24.6,1.5) circle (0.4cm); \fill[black!60!] (24.6,1.5) circle (0.3cm); \draw[thick] (24.2,1.5) --(23.7,1.5)--(23.7,1.0); \draw[thick] (23.4,1.0)--(24.0,1.0); \draw[thick] (23.5,0.85)--(23.9,0.85); \draw[thick] (23.6,0.70)--(23.8,0.70); \draw[thick] (26.0,1.5) circle (0.7cm); % Y-pos \fill[smallbutton] (14.8,4.9) circle (0.3cm); \node[scale={\scl}] at (14.8,5.5) {Y-pos I}; \fill[smallbutton] (26.0,4.9) circle (0.3cm); \node[scale={\scl}] at (26.0,5.5) {Y-pos II}; % Volt/div the foreach loop draws the two buttons \foreach \i / \b in {18/75,22.5/345}{ %Second parameter of the loop is the angle of the index mark \begin{scope}[xshift=\i cm,yshift=3.8cm,scale=0.85] \node[scale=\scl] at (0,2.3) {Volts/Div}; \node[scale=\scl,black] at (-1,-2.4) {V}; \node[scale=\scl,blue] at (1,-2.4) {mV}; \clip[rounded corners] (-2,-2) rectangle (2,2); \fill[black!30!,rounded corners,draw=black,thick] (-2,-2) rectangle (2,2); \fill[blue!50!black!20!,draw=black,thick] (30:1.1)--(30:3)--(3,-3)--(-90:3)--(-90:1.1) arc (-90:30:1.1); \draw[very thick,rounded corners](-2,-2) rectangle (2,2); \draw[thick] (0,0) circle (1.0); \foreach \i in {0,30,...,330} \draw[thick] (\i:1.2)--(\i:2.5); \foreach \i/\j in {15/50,45/.1,75/.2,105/.5,135/1,165/2,195/5,225/10, 255/20,285/5,315/10,345/20} \node[scale=\scl,black] at (\i:1.7) {\j}; \fill[blue!30!black!60!,draw=black,thick] (0,0) circle (0.8cm); % Here you set the right Volts/Div button \draw[ultra thick,red] (\b:0.3)--(\b:1.2); \end{scope}} % Upper right panel \fill[controlpanels] (13.7,6.5) rectangle (27.1,12.75); %On-Off button \draw[rounded corners,thick,blue] (13.9,10.5) rectangle (15.9,12.5); \fill[fill=red,draw=black,thick,rounded corners] (14.4,10.8) rectangle (15.3,11.2); \node[scale=\scl] at (14.8,12) {\textbf{Power}}; \node[scale=\scl] at (14.8,11.5) {\textbf{On/Off}}; % Focus-Intensity buttons \draw[rounded corners,thick,blue] (13.9,7.0) rectangle (15.9,10.0); \fill[smallbutton] (14.9,7.5) circle (0.3cm); \node[scale=\scl] at (14.9,8.2) {\textbf{Focus}}; \fill[smallbutton] (14.9,9) circle (0.3cm); \node[scale=\scl] at (14.9,9.6) {\textbf{Intens}}; % X-pos \fill[smallbutton] (24.5,9.9) circle (0.3cm); \node[scale={\scl}] at (24.5,10.5) {X-pos}; % Time/Div \begin{scope}[xshift=21cm,yshift=9.5cm,scale=1] \node[scale={1.25*\scl}] at (0,2.4) {Time/Div}; \clip[rounded corners] (-2.2,-2) rectangle (2.2,2); \fill[black!30!,rounded corners,draw=black,thick] (-2.2,-2) rectangle (2.2,2); \fill[blue!50!black!20!,draw=black,thick] (45:1.1)--(45:3)--(3,-3)--(-90:3)--(-90:1.1) arc (-90:45:1.1); \fill[green!50!black!40!,draw=black,thick] (45:1.1)--(45:3) arc(45:207:3) --(207:1.1) arc (207:45:1.1); \draw[very thick,rounded corners](-2.2,-2) rectangle (2.2,2); \node[scale={1.25*\scl}] at (-1.6,-1.6) {$s$}; \node[scale={1.25*\scl}] at (1.6,-1.6) {$\mu{}\,s$}; \node[scale={1.25*\scl}] at (-1.6,1.6) {$m\,s$}; \draw[thick] (0,0) circle (1.0); \foreach \i in {-72,-54,...,262} \draw[thick] (\i:1.15)--(\i:1.35); \foreach \i/\j in {-72/.5,-54/1,-36/2,-18/5,0/10,18/20,36/50,54/.1,72/.2,90/.5, 108/1,126/2,144/5,162/10,180/20,198/50,216/.1,234/.2,252/.5} \node[scale=\scl,black] at (\i:1.7){\j}; \fill[blue!30!black!60!,draw=black,thick] (0,0) circle (0.8cm); % Here you set the Time/Div button \draw[ultra thick,red] (-18:0.3)--(-18:1.2); % X-pos \end{scope} \end{tikzpicture} \end{document}
% % % technical area % chemistry % physics % % % short description % The Perrin - Jablonski diagram is convenient for % visualizing in a simple way, all possible photophysical processes % in molecular system. \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais]{babel} \usepackage[top=3cm,left=0cm,right=0cm,bottom=3cm]{geometry} \usepackage{tikz} % shadows only for title \usetikzlibrary{decorations.pathmorphing,shadows} \usepackage{hyperref} \hypersetup{% pdfauthor={Germain Salvato-Vallverdu},% pdftitle={Perrin - Jablonski diagram},% pdfkeywords={Tikz,latex,Conditions périodiques aux limites,boundaries condition,simulation},% pdfcreator={PDFLaTeX},% pdfproducer={PDFLaTeX},% } \title{Perrin - Jablonski diagram} \author{Germain Salvato-Vallverdu} \pagestyle{empty} \begin{document} \sffamily % colors \definecolor{turquoise}{rgb}{0 0.41 0.41} \definecolor{rouge}{rgb}{0.79 0.0 0.1} \definecolor{vert}{rgb}{0.15 0.4 0.1} \definecolor{mauve}{rgb}{0.6 0.4 0.8} \definecolor{violet}{rgb}{0.58 0. 0.41} \definecolor{orange}{rgb}{0.8 0.4 0.2} \definecolor{bleu}{rgb}{0.39, 0.58, 0.93} \begin{center} \begin{tikzpicture} \begin{huge} \node[at={(0,0)},text=bleu]{\bfseries Perrin -- Jablonski diagram}; \node[at={(0,0)},above,yscale=-1,scope fading=south, opacity=0.5,text=bleu]{\bfseries Perrin -- Jablonski diagram}; \end{huge} \end{tikzpicture} \vspace{1cm} \begin{tikzpicture} % styles \tikzstyle{elec} = [line width=2pt,draw=black!80] \tikzstyle{vib} = [thick,draw=black!30] \tikzstyle{trans} = [line width=2pt,->] \tikzstyle{transCI} = [trans,dashed,draw=vert] \tikzstyle{transCS} = [trans,dashed,draw=violet] \tikzstyle{relax} = [draw=orange,ultra thick,decorate,decoration=snake] \tikzstyle{rv} = [rotate=90,text=orange,pos=0.5,yshift=3mm] % fondamental \path[elec] (0,0) -- ++ (14,0) node[below,pos=0.5,yshift=-1mm] {\large Ground state $S_0$}; \path[vib] (0,0.2) -- ++ (14,0); \path[vib] (0,0.4) -- ++ (13,0); \foreach \i in {1,2,...,30} { \path[vib] (0,0.4 + \i*0.2) -- ++ ({2 + 10*exp(-0.2*\i)},0); } % T1 \path[elec] (11,4) -- ++ (3,0) node[anchor=south west] {\large $T_1$}; \foreach \i in {1,2,...,6} { \path[vib] (11,4 + \i*0.2) -- ++ (3,0); } % S1 \path[elec] (4,5) node[anchor=south east] {\large $S_1$} -- ++ (5,0); \foreach \i in {1,2,...,6} { \path[vib] (4,5 + \i*0.2) -- ++ (5,0); } \foreach \i in {1,2,...,12} { \path[vib] ({7.5 - 1*exp(-0.3*\i)},6.2+\i*0.2) -- (9,6.2+\i*0.2); } % S2 \path[elec] (4,8) node[anchor=south east] {\large $S_2$} -- ++ (2,0); \foreach \i in {1,2,...,6} { \path[vib] (4,8 + \i*0.2) -- ++ (2,0); } % absorption \path[trans,draw=turquoise] (4.5,0) -- ++(0,9) node[rotate=90,pos=0.35,text=turquoise,yshift=-3mm] {\large Absorption}; % fluo \path[trans,draw=rouge](7,5) -- ++(0,-4.4) node[rotate=90,pos=0.5,text=rouge,yshift=-3mm] {\large Fluorescence}; % phosphorescence \path[trans,draw=mauve] (13,4) -- ++(0,-3.4) node[rotate=90,pos=0.5,text=mauve,yshift=-3mm] {\large Phosphorescence}; % Conversion interne \path[transCI] (4,5) -- ++(-1.9,0) node[below,pos=0.5,text=vert] {\large IC}; \path[transCI] (6,8) -- ++(1.3,0) node[above,pos=0.5,text=vert] {\large IC}; % Croisement intersysteme \path[transCS] (9,5) -- ++(2,0) node[below,pos=0.5,text=violet] {\large ISC}; \path[transCS] (11,4) -- ++(-2.5,0) node[below,pos=0.5,text=violet] {\large ISC}; % relaxation vib \path[relax] (5.5,8.8) -- ++(0,-0.8) node[rv] {\textbf{VR}}; \path[relax] (8,8) -- ++(0,-3) node[rv] {\textbf{VR}}; \path[relax] (1,5) -- ++(0,-5) node[rv] {\textbf{VR}}; \path[relax] (11.5,5) -- ++(0,-1) node[rv] {\textbf{VR}}; \end{tikzpicture} \end{center} \vspace{1cm} \begin{tikzpicture} \node[at={(0,0)},text=bleu]{\bfseries Legend}; \node[at={(0,0)},above,yscale=-1,scope fading=south, opacity=0.5,text=bleu]{\bfseries Legend}; \end{tikzpicture} \begin{itemize} \item[] \tikz {\path[line width=2pt,->,dashed,draw=vert] (0,0) -- (1,0) node[above,pos=0.5,text=vert] {IC};} Internal Conversion, $S_i\,\longrightarrow\,S_j$ non radiative transition. \item[] \tikz {\path[line width=2pt,->,dashed,draw=violet] (0,0) -- (1,0) node[above,pos=0.5,text=violet] {ISC};} InterSystem Crossing, $S_i\,\longrightarrow\,T_j$ non radiative transition. \item[] \tikz {\path[line width=2pt,draw=orange,ultra thick, decorate,decoration=snake] (0,0) -- (1,0) node[above,pos=0.5,text=orange] {RV};} Vibrationnal Relaxation. \end{itemize} \end{document}
\documentclass{article} \usepackage{tikz-timing}[2009/05/15] \pagestyle{empty} \def\degr{${}^\circ$} \newif\ifcomment % Activate the following line to compile document with comments: %\commenttrue \begin{document} \ifcomment \newcommand{\qv}[1]{`\texttt{#1}'} \title{TikZ-Timing Example} \author{Martin Scharrer\\martin@scharrer-online.de} \maketitle \section{Step-By-Step Guide} \subsection{Intro} This example shows how to make a timing diagram with the \texttt{tikz-timing} package. This timing diagram was used by the package author in a recent work and shows several clock and pulse signals. The relationship between the clock and signal edges is shown using horizontal lines. Timing diagrams like this can be done using the \texttt{tikztimingtable} environment which has the same syntax as a \texttt{tabular} environment with two columns. The first column holds the signal name, the second one the timing characters. See the package manual for detailed information about them. \subsection{Clock Signals} Clock signals can be generated with the \qv{C} character. Here we want a clock signal which is two unit width wide and without slope, so we use \qv{2C} for every half clock period. We also use the \emph{repetition mode} to get the number of clock periods we want: \qv{12\{2C\}}. To shift the different clocks horizontal we use single \qv{H} or \qv{L} characters at the start. Also the \emph{initial character} is used so that the clock signals start with an edge if needed. The \emph{glitch} character \qv{G} is used at the end of two clocks so that the signal ends with an edge. \par\bigskip \begin{verbatim} \begin{tikztimingtable} Clock 128\,MHz 0\degr & H 12{2C} G \\ % ends with edge Clock 128\,MHz 90\degr & [C] 12{2C} C \\ % starts with edge Clock 128\,MHz 180\degr & C 12{2C} G \\ % ends with edge Clock 128\,MHz 270\degr & 12{2C} C \\ \end{tikztimingtable} \end{verbatim} \begin{tikztimingtable} Clock 128\,MHz 0\degr & H 12{2C} G \\ % ends with edge Clock 128\,MHz 90\degr & [C] 12{2C} C \\ % starts with edge Clock 128\,MHz 180\degr & C 12{2C} G \\ % ends with edge Clock 128\,MHz 270\degr & 12{2C} C \\ \end{tikztimingtable} \subsection{Pulse and other Signals} The pulses are simply set using \qv{H} (high) or \qv{L} (low) signals. The number before the characters is the width. Note that \qv{LLL}, \qv{3L}, \qv{2LL} or \qv{3\{L\}} all result in the same signal: a low signal with three times the unit width. An empty line can be inserted to produce a vertical space between groups of signals. \begin{verbatim} \begin{tikztimingtable} Coarse Pulse & 3L 16H 6L \\ Coarse Pulse - Delayed 1 & 4L 16H 5L \\ Coarse Pulse - Delayed 2 & 5L 16H 4L \\ Coarse Pulse - Delayed 3 & 6L 16H 3L \\ \\ % Gives vertical space Final Pulse Set & 3L 16H 6L \\ Final Pulse $\overline{\mbox{Reset}}$ & 6L 16H 3L \\ Final Pulse & 3L 19H 3L \\ \end{tikztimingtable} \end{verbatim} \begin{tikztimingtable} Coarse Pulse & 3L 16H 6L \\ Coarse Pulse - Delayed 1 & 4L 16H 5L \\ Coarse Pulse - Delayed 2 & 5L 16H 4L \\ Coarse Pulse - Delayed 3 & 6L 16H 3L \\ \\ % Gives vertical space Final Pulse Set & 3L 16H 6L \\ Final Pulse $\overline{\mbox{Reset}}$ & 6L 16H 3L \\ Final Pulse & 3L 19H 3L \\ \end{tikztimingtable} \subsection{Drawing Relationship Lines} To draw own lines inside the timing diagram use \verb+\extracode+ after the last table line. Any kind of PGF/TikZ macros can be placed between this macro and the end of the table environment. The coordinate origin is on the baseline of the first timing line. See also the package manual for more information. To simplify the drawing process we simply add named notes into the timing line using the \qv{N(\textit{name})} character. All start points are called \qv{A\textit{number}} and all corresponding end points are called \qv{B\textit{number}}. The notes are placed at the appropriate positions and do not produce any graphic but only name the current position. Some repetition must be spited in multiple parts to allow the notes to be set: \begin{verbatim} Clock 128\,MHz 0\degr & H 12{2C} G \\ % without notes Clock 128\,MHz 0\degr & H 2C N(A1) 8{2C} N(A5) 3{2C} G \\ % with notes \end{verbatim} The lines are then drawn using the \texttt{foreach} loop of the PGF package. The background layer is used to not overdraw the timing signals. The predefined style \qv{help lines} is used to get gray thin lines. This code must be placed after the \verb+\extracode+ macro. \begin{verbatim} \begin{pgfonlayer}{background} \foreach \n in {1,...,8} \draw [help lines] (A\n) -- (B\n); \end{pgfonlayer} \end{verbatim} This shows that the consistent naming of the nodes makes the drawing code very simple. \subsection{Adding Table Rules} To add \texttt{booktab} like table rules simply add the command \verb+\tablerules+ to the \texttt{extracode} section. \section{Final Code and Result} \begin{verbatim} \def\degr{${}^\circ$} \begin{tikztimingtable} Clock 128\,MHz 0\degr & H 2C N(A1) 8{2C} N(A5) 3{2C} G\\ Clock 128\,MHz 90\degr & [C] 2{2C} N(A2) 8{2C} N(A6) 2{2C} C\\ Clock 128\,MHz 180\degr & C 2{2C} N(A3) 8{2C} N(A7) 2{2C} G\\ Clock 128\,MHz 270\degr & 3{2C} N(A4) 8{2C} N(A8) 2C C\\ Coarse Pulse & 3L 16H 6L \\ Coarse Pulse - Delayed 1 & 4L N(B2) 16H N(B6) 5L \\ Coarse Pulse - Delayed 2 & 5L N(B3) 16H N(B7) 4L \\ Coarse Pulse - Delayed 3 & 6L 16H 3L \\ \\ Final Pulse Set & 3L 16H N(B5) 6L \\ Final Pulse $\overline{\mbox{Reset}}$ & 6L N(B4) 16H 3L \\ Final Pulse & 3L N(B1) 19H N(B8) 3L \\ \extracode \tablerules \begin{pgfonlayer}{background} \foreach \n in {1,...,8} \draw [help lines] (A\n) -- (B\n); \end{pgfonlayer} \end{tikztimingtable} \end{verbatim} \fi % ifcomment \def\degr{${}^\circ$} \begin{tikztimingtable} Clock 128\,MHz 0\degr & H 2C N(A1) 8{2C} N(A5) 3{2C} G\\ Clock 128\,MHz 90\degr & [C] 2{2C} N(A2) 8{2C} N(A6) 2{2C} C\\ Clock 128\,MHz 180\degr & C 2{2C} N(A3) 8{2C} N(A7) 2{2C} G\\ Clock 128\,MHz 270\degr & 3{2C} N(A4) 8{2C} N(A8) 2C C\\ Coarse Pulse & 3L 16H 6L \\ Coarse Pulse - Delayed 1 & 4L N(B2) 16H N(B6) 5L \\ Coarse Pulse - Delayed 2 & 5L N(B3) 16H N(B7) 4L \\ Coarse Pulse - Delayed 3 & 6L 16H 3L \\ \\ Final Pulse Set & 3L 16H N(B5) 6L \\ Final Pulse $\overline{\mbox{Reset}}$ & 6L N(B4) 16H 3L \\ Final Pulse & 3L N(B1) 19H N(B8) 3L \\ \extracode \tablerules \begin{pgfonlayer}{background} \foreach \n in {1,...,8} \draw [help lines] (A\n) -- (B\n); \end{pgfonlayer} \end{tikztimingtable} % \end{document}
\documentclass[tikz,11pt]{{standalone}} \usepackage{calligra} \usepackage[T1]{fontenc} \usetikzlibrary{% shapes, shadows, patterns, calc, decorations.shapes, decorations.fractals, decorations.markings, decorations.pathmorphing } \colorlet{bodycolor}{black!35!gray!60!brown!98!green} \colorlet{bellycolor}{yellow!70!white!92!green} \tikzset{ furspot/.pic = { \path [draw = black, thick, fill] (0,0) .. controls +(0.3,0) and +(0.25,-0.05) .. ++(0.35,-.45) .. controls +(-0.45,0.25) and +(0.1,0) .. ++(-0.85,-0.05) .. controls +(-0.3,0.1) and +(-0.4, 0) .. cycle; }, claw/.pic = { \path [fill = bodycolor!70, draw] (0,0) arc (0:45:0.2 and 0.8) arc (135:180:0.2 and 0.8) arc (180:360:0.059) -- cycle; }, whiskers/.pic = { \path [fill = bodycolor!70,draw] (0,0) arc (0:45:0.05 and 2.3) arc (135:180:0.3 and 2.3) to[out=-90,in=-90] cycle; }, snowflake/.pic = { \fill [decoration = Koch snowflake, white] decorate{ decorate{ decorate{ (-0.5,-0.3) -- ++(60:1) -- ++(-60:1) -- cycle }}}; \foreach \i in {30, 90, 150, 210, 270, 330} { \draw[blue!50!white,very thin] (0,0) -- +(\i:0.3); } \draw[decoration = Koch snowflake, blue!50!white, very thin] decorate{($(0,0)+(60:0.2)$) -- ($(0,0)+(300:0.2)$) -- ($(0,0)+(180:0.2)$) -- cycle}; } } \tikzset{ snow/.style = {decoration = {random steps, segment length = 2mm, amplitude = 0.4mm}, decorate}, plush/.style = {decoration = {random steps, segment length = 1mm, amplitude = 0.5mm},decorate} } \begin{document} \begin{tikzpicture}[color = bodycolor, draw = black, thick] %---------------------background and tail---------------------- % blue sky \fill[blue!30!white] (-8cm,-11cm) rectangle (8cm,10cm); % random snowflakes \foreach \i in {0.1,0.11,...,1}{ \pic [scale = \i, opacity = 0.9] at (rand*7.5, rnd*18-10.5) {snowflake};} % more tiny snowflakes %\foreach \i in {0.1,0.11,...,0.5}{ %\pic [scale = \i, opacity = 0.9] at (rand*7.5, rnd*18-10.5) {snowflake};} % cloud with merry christmas \node [cloud,aspect = 6.5, cloud puff arc = 120, cloud puffs = 12.9, fill = white, color = white] at (0,7) {\Huge M \hspace{9.8cm}.}; \node [color = red] at (0,7) {\fontsize{50}{80} \textbf{Merry Christmas \quad }}; % tail \path [draw, fill, rotate = 50] (-4,-7.5) circle (1.5 and 2.2); % snowhill \fill [draw, gray!6, snow] (-8,-11) to[in=200, out=0] (-3,-7.5) to (3,-7.5) to[out=-20, in=180] (8,-11); %--------------------body----------------------------------------- % right ear \path [fill, draw] (0.6,2.3)+(-45:1) arc (-60:35:1 and 1.5) arc (115:210:1 and 1.5); % left ear \path [fill, draw] (-0.6,2.3)+(-135:1) arc (-120:-215:1 and 1.5) arc (65:-30:1 and 1.5); % head \path [draw, fill] ($(0,0)+(170:2.5 and 2)$) arc (170:10:2.5 and 2) arc(35:-20: 3 and 2) -- ($(0,-0.8)+(200:3 and 2)$) arc (200:145:3 and 2) -- cycle; % body \path[fill] ($(0,-4)+(200:4 and 4.5)$) arc (200:-20:4 and 4.5); %----------------------face---------------------------------------- % left eye \path [draw, fill = white] (-1.4,0.7) circle (0.45 and 0.4); \fill [black] (-1.2,0.7) circle (0.16); \fill [white] (-1.24,0.74) circle (0.03); % right eye \path [draw, fill = white, thick] (1.4,0.7) circle (0.4); \fill [black] (1.25,0.7) circle (0.16); \fill [white] (1.20,0.74) circle (0.03); % nose \path [draw] (0.35, 0.7) .. controls (0.2,0.8) and (-0.2, 0.8) .. (-0.35, 0.7); \path [fill = black] (0, 0.53) -- (0.25, 0.6) .. controls (0.3,0.75) and (-0.3, 0.75) .. (-0.25, 0.6) -- cycle; \pic [scale = 0.3] at (0,0.8) {snowflake}; % mouth \draw (-0.05,-0.5) arc (140:85:0.2 and 0.1); % whiskers \foreach \i/\j/\k/\l/\m in {80/1/1.5/-2/0, -90/-1/1.5/-2.2/-0.2, -80/-0.8/1.5/-2.5/-0.5, -80/1/1.3/2.2/0, 90/-1/1.3/2.4/-0.2, 80/-1/1.3/2.6/-0.4} \pic [rotate = \i, scale = \j, yscale = \k] at (\l,\m) {whiskers}; %-----------------------------arms---------------------------------- % handclaws \foreach \i in {-4,-3.8,-3.6,3.9,3.7,3.5} { \pic [rotate = 180] at (\i,-6.5) {claw};} % left arm \path [draw, fill] (-3, -1) .. controls (-5.5,-3.5) and (-4.5,-7.5) .. (-3.35,-6.45); % right arm \path [draw, fill] (3, -1) .. controls (5.5,-3.5) and (4.5,-7.5) .. (3.35,-6.45); %------------------------belly---------------------------------- \draw[fill = bellycolor] ($(0,-4.7)+(230:3.8 and 4)$) to [out = -10,in = 190] ($(0,-4.7)+(-50:3.8 and 4)$) to ($(0,-4)+(-50:4.5)$) to [out = 60, in = -70] ($(0,-4.7)+(50:3.8 and 4)$) arc (50:130:3.8 and 4) to [out = -110, in = 120] ($(0,-4)+(-130:4.5)$) to cycle; % fur spots \foreach \i/\j/\k in {0/0/-1.3, -15/1.6/-1.5, 15/-1.6/-1.5, -8/0.7/-2.2, 8/-0.7/-2.2, -22/2.2/-2.5, 22/-2.2/-2.5} { \pic [rotate = \i] at (\j, \k) {furspot};} %------------------------legs and feet-------------------------- %legs \path [draw, rotate = 32, fill] (-5.8,-5.2) circle (0.9 and 1.4); \path [draw, rotate = -32, fill] (5.8,-5.2) circle (0.9 and 1.4); % left feet \path [draw, fill, rotate = 30] (-5.6,-6.1) circle (0.65 and 0.6); \path [draw, fill, rotate = -30] (5.6,-6.1) circle (0.65 and 0.6); % toe beans \path [draw, fill = bodycolor!50!white, rotate = 45] (-7,-4.7) circle (0.3 and 0.17); \path [draw ,fill = bodycolor!50!white, rotate = -45] (7,-4.7) circle (0.3 and 0.17); % footclaws \foreach \i/\j/\k in {50/-2.2/-7.9,40/-2/-7.7,30/-1.75/-7.55, -50/2.3/-8,-40/2.1/-7.8,-30/1.85/-7.65} { \pic [rotate = \i] at (\j,\k) {claw};} % hat \path [draw, fill = red] (43:2.5) to [in = -170, out = 130] ($(0.7,3)+(195:0.4)$) to [in = 180, out = 90] (0.7,3.1) to [out = 150, in = 0] (0,3.3) to [in = 50, out = 180] (137:2.5); \fill [draw, plush, fill = white, thin] (145:2.5 and 2) to [in = 160, out = 20] (35:2.5 and 2) to [out = 80, in = -80] ++(0,0.5) to [out = 160, in = 20] ($(145:2.5 and 2) +(0,0.5)$) to [in = 100, out = -100] cycle; \fill [draw, plush, fill = white, thin] (0.7,3.1) circle (0.5); \end{tikzpicture} \end{document}