|
| 1 | +\documentclass{article} |
| 2 | + |
| 3 | +% import tikz |
| 4 | +\usepackage{tikz} |
| 5 | +\usetikzlibrary{decorations.pathreplacing, positioning, calc, backgrounds, arrows.meta} |
| 6 | + |
| 7 | +% make the document the exact size of the figure |
| 8 | +\usepackage[active,tightpage]{preview} |
| 9 | +\renewcommand\PreviewBbAdjust{0bp 0bp 0bp 0bp} |
| 10 | +\PreviewEnvironment[]{tikzpicture} |
| 11 | +\usepackage[T1]{fontenc} |
| 12 | + |
| 13 | +% Colors - seaborn colorblind palette |
| 14 | +\definecolor{color0}{HTML}{0173b2} % blue |
| 15 | +\definecolor{color1}{HTML}{de8f05} % orange |
| 16 | +\definecolor{color2}{HTML}{029e73} % green |
| 17 | +\definecolor{color3}{HTML}{d55e00} |
| 18 | +\definecolor{color4}{HTML}{cc78bc} |
| 19 | +\definecolor{color5}{HTML}{ca9161} |
| 20 | +\definecolor{color6}{HTML}{fbafe4} |
| 21 | +\definecolor{color7}{HTML}{949494} |
| 22 | +\definecolor{color8}{HTML}{ece133} |
| 23 | +\definecolor{color9}{HTML}{56b4e9} |
| 24 | + |
| 25 | +\begin{document} |
| 26 | +\begin{tikzpicture}[ |
| 27 | + CIRCLE/.style={circle, draw, very thick, inner sep=0pt}, |
| 28 | + FAC/.style={rectangle, minimum size=1mm, inner sep=0pt, draw, fill}, |
| 29 | + OLD/.style={fill=color7!55, draw=color7!55}, |
| 30 | + ] |
| 31 | + % Setup all constants |
| 32 | + \coordinate (zoom) at (-0.6,-0.9); |
| 33 | + \pgfmathsetlengthmacro{\circleradius}{0.155\columnwidth}; |
| 34 | + \pgfmathsetlengthmacro{\circlediameter}{2.0 * \circleradius}; |
| 35 | + |
| 36 | + % ------------------------- main image ------------------------- % |
| 37 | + \node[inner sep=1pt] (image) at (0,0) { |
| 38 | + \includegraphics[width=0.99\columnwidth]{../graphics/readme_big.png} |
| 39 | + }; |
| 40 | + |
| 41 | + % ------------------------- zoom in ------------------------- % |
| 42 | + \begin{scope}[shift={(image.south west)}, xshift=130mm, yshift=57mm] |
| 43 | + \begin{scope} |
| 44 | + \path[clip] (0,0) circle [x radius=\circleradius, y radius=\circleradius]; |
| 45 | + \node[inner sep=0pt] { |
| 46 | + \includegraphics[width=\circlediameter]{../graphics/readme_small.png} |
| 47 | + }; |
| 48 | + \end{scope} |
| 49 | + \node[CIRCLE, minimum size=\circlediameter] (zoom_big) {}; |
| 50 | + \end{scope} |
| 51 | + |
| 52 | + \node[circle, draw, thick, minimum size=9mm, inner sep=0pt] (zoom_small) at (zoom) {}; |
| 53 | + \path[draw, thick] (zoom_big.north west) -- (zoom_small.north west); |
| 54 | + \path[draw, thick] (zoom_big.south) -- (zoom_small.south); |
| 55 | + |
| 56 | + |
| 57 | + % ------------------------- Factor graph ------------------------- % |
| 58 | + \node[CIRCLE, minimum size=\circlediameter, fill=white] (graph) [below=2mm of zoom_big] {}; |
| 59 | + |
| 60 | + \begin{scope}[node distance=2mm] |
| 61 | + \node[CIRCLE, thin, minimum size=5mm, draw=none, text=white, fill=color0!80] (x_0) at (graph) [xshift=-15mm] {\(X\)}; |
| 62 | + \node[CIRCLE, thin, minimum size=5mm, draw=none, text=white, fill=color1!80] (x_1) [right=of x_0] {\(X\)}; |
| 63 | + \node[CIRCLE, thin, minimum size=5mm, draw=none, text=white, fill=color2!80] (x_2) [right=of x_1] {\(X\)}; |
| 64 | + |
| 65 | + \node (dots) [right=of x_2] {\(\cdots\)}; |
| 66 | + \node[CIRCLE, thin, minimum size=5mm, draw=none, text=white, fill=black] (x_3) [right=of dots] {\(X\)}; |
| 67 | + \end{scope} |
| 68 | + |
| 69 | + % Marg Factor |
| 70 | + \node[FAC] (marg) [below=7mm of x_2] {}; |
| 71 | + \draw (x_0) -- (marg); |
| 72 | + \draw (x_1) -- (marg); |
| 73 | + \draw (x_2) -- (marg); |
| 74 | + \draw (dots) -- (marg); |
| 75 | + |
| 76 | + % Random connections |
| 77 | + \path[OLD] (x_0) edge[bend left = 55] node[FAC, OLD, pos=0.5] {} (x_1); |
| 78 | + \path[OLD] (x_0) edge[bend left = 55] node[FAC, OLD, pos=0.5] {} (x_2); |
| 79 | + \path[OLD] (x_0) edge[bend left = 55] node[FAC, OLD, pos=0.5] {} (dots); |
| 80 | + \path[OLD] (x_1) edge[bend left = 55] node[FAC, OLD, pos=0.5] {} (x_2); |
| 81 | + \path[OLD] (x_1) edge[bend left = 55] node[FAC, OLD, pos=0.5] {} (dots); |
| 82 | + \path[OLD] (x_2) edge[bend left = 55] node[FAC, OLD, pos=0.5] {} (dots); |
| 83 | + |
| 84 | + % Most recent connections |
| 85 | + \path (x_0) edge[bend left=65] node[FAC, pos=0.35] {} (x_3); |
| 86 | + \path (x_1) edge[bend left=65] node[FAC, pos=0.35] {} (x_3); |
| 87 | + \path (x_2) edge[bend left=65] node[FAC, pos=0.35] {} (x_3); |
| 88 | + \path (dots) edge[bend left=65] node[FAC, pos=0.35] {} (x_3); |
| 89 | + |
| 90 | + |
| 91 | + % arrow between circles |
| 92 | + \path[->, -{Latex[length=3mm]}, ultra thick] (zoom_big.south east) edge[bend right=-45] (graph.north east); |
| 93 | + |
| 94 | +\end{tikzpicture} |
| 95 | +\end{document} |
0 commit comments