Last active
April 2, 2024 14:22
-
-
Save FredrikMeyer/2b2a4fffe77b0997282f40a601b443fd to your computer and use it in GitHub Desktop.
2dtree (graphviz + gnuplot)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph { | |
node [ shape = record, height=.1]; | |
node0[label = "<f0> lower |<f1> pt: [0.5 0.5] |<f2> higher"]; | |
node1[label = "<f0> lower |<f1> pt: [0.6 0.3] |<f2> higher"]; | |
node2[label = "<f0> lower |<f1> pt: [0.7 0.8] |<f2> higher"]; | |
node3[label = "<f0> lower |<f1> pt: [0.4 0.8] |<f2> higher"]; | |
node4[label = "<f0> lower |<f1> pt: [0.4 0.6] |<f2> higher"]; | |
"node0":f2 -> "node1":f1; | |
node1:f2 -> node2:f1; | |
node0:f0 -> node3:f1; | |
node3:f0 -> node4:f1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reset | |
unset key; | |
set title "2d Tree Visualization"; | |
set label '[0.5 0.5]' at 0.5,0.5 left offset char 1,1; | |
set label '[0.6 0.3]' at 0.6,0.3 left offset char 1,-1; | |
set label '[0.7 0.8]' at 0.7,0.8 left offset char 1; | |
set label '[0.4 0.8]' at 0.4,0.8 left offset char -1,1; | |
set label '[0.4 0.6]' at 0.4,0.6 right offset char -0.5,1; | |
set xrange [0:1]; | |
set yrange [0:1]; | |
set style line 1 lc rgb 'black' pt 7; | |
plot '-' with points ls 1, \ | |
'-' with lines ls 1 | |
# Points data | |
0.5 0.5 | |
0.6 0.3 | |
0.7 0.8 | |
0.4 0.8 | |
0.4 0.6 | |
e | |
# Lines data | |
0.5 0.0 | |
0.5 1 | |
0.5 0.3 | |
1 0.3 | |
0.7 0.3 | |
0.7 1 | |
0.0 0.8 | |
0.5 0.8 | |
0.4 0 | |
0.4 0.8 | |
e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See pictures here: https://fredrikmeyer.net/2024/04/02/2d-tree.html