|
1 | 1 | \documentclass[tikz]{standalone} |
2 | 2 | \usepackage[blue]{causets} |
3 | 3 | \usetikzlibrary{fit,shapes.geometric} |
| 4 | +% Set colours and style: |
| 5 | +\colorlet{future colour}{green!50!black} |
| 6 | +\colorlet{past colour}{yellow!50!orange!80!black} |
| 7 | +\colorlet{anywhere colour}{red!80!black} |
| 8 | +\tikzset{prob arrow/.style={line width=1.5pt}} |
| 9 | +% Define some helper functions: |
| 10 | +\newcommand*{\semiopaque}[1]{% Adds a transparency group. |
| 11 | +\begin{scope}[transparency group, opacity=0.5] |
| 12 | + #1 |
| 13 | +\end{scope} |
| 14 | +} |
| 15 | +\newcommand*{\drawprobarrow}[4][]{% Draws a (probability) arrow. |
| 16 | +\draw[prob arrow] (#2) -- node[sloped, midway, below, #1] {$#3$} (#4); |
| 17 | +} |
| 18 | +\newcommand{\drawlegendsymbol}{% Draws the symbol for a legend entry. |
| 19 | +\draw[prob arrow] (0,0) -- +(10pt, 6pt); |
| 20 | +} |
| 21 | +\newcommand{\legendsymbol}[1]{% Creates the legend symbol. |
| 22 | +\begin{tikzpicture} |
| 23 | + \ifnum#1=0 |
| 24 | + \drawlegendsymbol |
| 25 | + \else |
| 26 | + \semiopaque{\drawlegendsymbol} |
| 27 | + \fi |
| 28 | +\end{tikzpicture} |
| 29 | +} |
4 | 30 | \begin{document} |
5 | | -\begin{tikzpicture}[-stealth, line width=2pt] |
6 | | - \matrix[nodes={draw, fill=yellow!10, thin, circle, inner sep=0.6ex, minimum size=5ex}, row sep=1.5cm, column sep=0.1cm] |
7 | | - { |
8 | | - \node (C1234) {\pcauset{1,2,3,4}}; |
9 | | - & \node (C1243) {\pcauset{1,2,4,3}}; |
10 | | - & \node[fill=yellow!20] (C1423) {\pcauset{1,4,2,3}}; |
11 | | - & \node (C1324) {\pcauset{1,3,2,4}}; |
12 | | - & \node (C1432) {\pcauset{1,4,3,2}}; |
13 | | - & \node[fill=yellow!30] (C4123) {\pcauset{4,1,2,3}}; |
14 | | - & \node[fill=yellow!30] (C4132) {\pcauset{4,1,3,2}}; |
15 | | - & \node[fill=yellow!20] (C3124) {\pcauset{3,1,2,4}}; |
16 | | - & & \node[fill=yellow!20] (C3412) {\pcauset{3,4,1,2}}; |
17 | | - & \node[fill=yellow!30] (C3142) {\pcauset{3,1,4,2}}; |
18 | | - & \node[fill=yellow!30] (C4312) {\pcauset{4,3,1,2}}; |
19 | | - & \node (C2134) {\pcauset{2,1,3,4}}; |
20 | | - & \node (C2143) {\pcauset{2,1,4,3}}; |
21 | | - & \node[fill=yellow!20] (C4213) {\pcauset{4,2,1,3}}; |
22 | | - & \node (C3214) {\pcauset{3,2,1,4}}; |
23 | | - & \node (C4321) {\pcauset{4,3,2,1}}; |
24 | | - \\ |
25 | | - \\ |
26 | | - & & \node (C123) {\pcauset{1,2,3}}; |
27 | | - & & & \node (C132) {\pcauset{1,3,2}}; |
28 | | - & & & \node[fill=yellow!20] (C312) {\pcauset{3,1,2}}; |
29 | | - & & & \node (C213) {\pcauset{2,1,3}}; |
30 | | - & & & \node (C321) {\pcauset{3,2,1}}; |
31 | | - \\ |
32 | | - & & & & & \node (C12) {\pcauset{1,2}}; |
33 | | - & & & & & & \node (C21) {\pcauset{2,1}}; |
34 | | - \\ |
35 | | - & & & & & & & & \node (C1) {\pcauset{1}}; |
36 | | - \\ |
37 | | - }; |
38 | | - \draw (C1) -- node[below left] {$p_{12}$} (C12); |
39 | | - \draw (C12) -- node[below left] {$p_{123}$} (C123); |
40 | | - \draw (C123) -- node[sloped, midway, below] {$p_{1234}$} (C1234); |
41 | | - \draw (C123) -- node[sloped, near end, below] {$p_{1243}$} (C1243); |
42 | | - \draw (C123) -- node[sloped, midway, below] {$p_{1423}$} (C1423); |
43 | | - \draw (C123) -- node[sloped, near start, below] {$p_{4123}$} (C4123); |
44 | | - \draw (C12) -- node[left] {$p_{132}$} (C132); |
45 | | - \draw (C132) -- node[sloped, near start, below] {$p_{1342}$} (C1423); |
46 | | - \draw (C132) -- node[sloped, near end, below] {$p_{1324}$} (C1324); |
47 | | - \draw (C132) -- node[sloped, midway, above] {$p_{1432}$} (C1432); |
48 | | - \draw (C132) -- node[sloped, near start, below] {$p_{4132}$} (C4132); |
49 | | - \draw (C12) -- node[below right] {$p_{312}$} (C312); |
50 | | - \draw (C312) -- node[sloped, near end, above] {$p_{3124}$} (C3124); |
51 | | - \draw (C312) -- node[sloped, near end, above] {$p_{3412}$} (C3412); |
52 | | - \draw (C312) -- node[sloped, near end, above] {$p_{3142}$} (C3142); |
53 | | - \draw (C312) -- node[sloped, near start, below] {$p_{4312}$} (C4312); |
54 | | - \draw (C1) -- node[below right] {$p_{21}$} (C21); |
55 | | - \draw (C21) -- node[below left] {$p_{231}$} (C312); |
56 | | - \draw (C312) -- node[sloped, near start, below] {$p_{2341}$} (C4123); |
57 | | - \draw (C312) -- node[sloped, near end, above] {$p_{2431}$} (C4132); |
58 | | - \draw (C21) -- node[right] {$p_{213}$} (C213); |
59 | | - \draw (C213) -- node[sloped, midway, above] {$p_{2134}$} (C2134); |
60 | | - \draw (C213) -- node[sloped, near start, below] {$p_{2413}$} (C3142); |
61 | | - \draw (C213) -- node[sloped, near end, below] {$p_{2143}$} (C2143); |
62 | | - \draw (C213) -- node[sloped, near start, below] {$p_{4213}$} (C4213); |
63 | | - \draw (C21) -- node[below right] {$p_{321}$} (C321); |
64 | | - \draw (C321) -- node[sloped, near start, below] {$p_{3421}$} (C4312); |
65 | | - \draw (C321) -- node[sloped, midway, above] {$p_{3241}$} (C4213); |
66 | | - \draw (C321) -- node[sloped, near end, above] {$p_{3214}$} (C3214); |
67 | | - \draw (C321) -- node[sloped, midway, below] {$p_{4321}$} (C4321); |
| 31 | +\begin{tikzpicture}[-stealth] |
| 32 | + \def\ystep{2.0cm} |
| 33 | + \def\xstep{0.52cm} |
| 34 | + % Create nodes of all causets with 1 to 4 events: |
| 35 | + \begin{scope}[nodes={draw, thin, circle, minimum size=1.02cm}] |
| 36 | + \node (C1) at ( 0, 0) {\pcauset{1}}; |
| 37 | + \node (C12) at (-4*\xstep, 1*\ystep) {\pcauset{1,2}}; |
| 38 | + \node (C21) at ( 4*\xstep, 1*\ystep) {\pcauset{2,1}}; |
| 39 | + \foreach \CPoint/\CXPos/\CPerm in {C123/-8/{{1,2,3}}, C132/-4/{{1,3,2}}, C312/0/{{3,1,2}}, C213/4/{{2,1,3}}, C321/8/{{3,2,1}}} |
| 40 | + \node (\CPoint) at (\CXPos*\xstep, 2*\ystep) {\expandafter\pcauset\CPerm}; |
| 41 | + \foreach \CPoint/\CXPos/\CPerm in {C1234/-15/{{1,2,3,4}}, C1243/-13/{{1,2,4,3}}, C1423/-11/{{1,4,2,3}}, C1324/-9/{{1,3,2,4}}, C1432/-7/{{1,4,3,2}}, C4123/-5/{{4,1,2,3}}, C4132/-3/{{4,1,3,2}}, C3124/-1/{{3,1,2,4}}, C3412/1/{{3,4,1,2}}, C3142/3/{{3,1,4,2}}, C4312/5/{{4,3,1,2}}, C2134/7/{{2,1,3,4}}, C2143/9/{{2,1,4,3}}, C4213/11/{{4,2,1,3}}, C3214/13/{{3,2,1,4}}, C4321/15/{{4,3,2,1}}} |
| 42 | + \node (\CPoint) at (\CXPos*\xstep, 3.75*\ystep) {\expandafter\pcauset\CPerm}; |
| 43 | + \end{scope} |
| 44 | + % Add graph edges for expandings ... |
| 45 | + % ... to the past (additionally): |
| 46 | + \begin{scope}[past colour] |
| 47 | + \foreach \StartPoint/\EndPoint in {C12/C213, C123/C3124, C123/C2134, C132/C1243, C132/C3142, C132/C2143, C312/C1423, C312/C4213, C213/C1324, C213/C3124, C213/C3214, C321/C1432, C321/C4132, C21/C132} |
| 48 | + \semiopaque{\drawprobarrow{\StartPoint}{}{\EndPoint}}; |
| 49 | + \end{scope} |
| 50 | + % ... to anywhere (additionally, further): |
| 51 | + \begin{scope}[anywhere colour] |
| 52 | + \semiopaque{\drawprobarrow{C123}{}{C1324}}; |
| 53 | + \end{scope} |
| 54 | + % ... to the future: |
| 55 | + \begin{scope}[prob arrow, future colour] |
| 56 | + \drawprobarrow{C1}{p_{12}}{C12} |
| 57 | + \drawprobarrow{C12}{p_{123}}{C123} |
| 58 | + \drawprobarrow{C123}{p_{1234}}{C1234} |
| 59 | + \drawprobarrow[near end]{C123}{p_{1243}}{C1243} |
| 60 | + \drawprobarrow[near end]{C123}{p_{1423}}{C1423} |
| 61 | + \drawprobarrow[near start, above]{C123}{p_{4123}}{C4123} |
| 62 | + \drawprobarrow[above]{C12}{p_{132}}{C132} |
| 63 | + \drawprobarrow[near end]{C132}{p_{1342}}{C1423} |
| 64 | + \drawprobarrow[near end]{C132}{p_{1324}}{C1324} |
| 65 | + \drawprobarrow[midway, above]{C132}{p_{1432}}{C1432} |
| 66 | + \drawprobarrow[near start]{C132}{p_{4132}}{C4132} |
| 67 | + \drawprobarrow[near start, above]{C12}{p_{312}}{C312} |
| 68 | + \drawprobarrow[near end]{C312}{p_{3124}}{C3124} |
| 69 | + \drawprobarrow[near end]{C312}{p_{3412}}{C3412} |
| 70 | + \drawprobarrow[near end]{C312}{p_{3142}}{C3142} |
| 71 | + \drawprobarrow[near start]{C312}{p_{4312}}{C4312} |
| 72 | + \drawprobarrow{C1}{p_{21}}{C21} |
| 73 | + \drawprobarrow[near start, above]{C21}{p_{231}}{C312} |
| 74 | + \drawprobarrow[near start]{C312}{p_{2341}}{C4123} |
| 75 | + \drawprobarrow[near end]{C312}{p_{2431}}{C4132} |
| 76 | + \drawprobarrow{C21}{p_{213}}{C213} |
| 77 | + \drawprobarrow[above]{C213}{p_{2134}}{C2134} |
| 78 | + \drawprobarrow[near start]{C213}{p_{2413}}{C3142} |
| 79 | + \drawprobarrow[near end]{C213}{p_{2143}}{C2143} |
| 80 | + \drawprobarrow[near end]{C213}{p_{4213}}{C4213} |
| 81 | + \drawprobarrow{C21}{p_{321}}{C321} |
| 82 | + \drawprobarrow[near start, above]{C321}{p_{3421}}{C4312} |
| 83 | + \drawprobarrow[near end]{C321}{p_{3241}}{C4213} |
| 84 | + \drawprobarrow[near end]{C321}{p_{3214}}{C3214} |
| 85 | + \drawprobarrow{C321}{p_{4321}}{C4321} |
| 86 | + \end{scope} |
| 87 | + % Add legend: |
| 88 | + \node[above left, align=left, draw, inner sep=3ex, fill=gray!05] |
| 89 | + at (15*\xstep, 0) |
| 90 | + {Expanding into\\ |
| 91 | + \bfseries\color{future colour}\legendsymbol{0}\ the future\\ |
| 92 | + \bfseries\color{past colour}\legendsymbol{1}\ + the past\\ |
| 93 | + \bfseries\color{anywhere colour}\legendsymbol{1}\ + anywhere}; |
68 | 94 | \end{tikzpicture} |
69 | 95 | \end{document} |
0 commit comments