Notes on GraphViz
Basics
Graphviz Online is a really nice viewer
Grouping
- You can set attributes globally or per subgraph
edge [color="white"]
makes all child edges white, unless overwritten
Labeling things
I figured out this way to label different ranks by using an invisible pseudo-graph: viewer
This is the chunk:
subgraph labels {
edge [fontcolor="black"];
node [style="filled", fontcolor="black", fontsize=10];
node1 [label="Inputs"];
node2 [label="Weights"];
node3 [label="Sum"];
node4 [label="Activation\nfunction"];
node5 [label="Output"];
node1 -> node2 -> node3 -> node4 -> node5;
{rank=same; node1;n0;n1; n2; n3;}
{rank=same; node3;sum;}
}
Note using ranks to align inputs/sum to the correct level; also the use of \n
in the label.
Adding labels under nodes
xlabel
, and use HTML to make it a diff color than the main label. dot - Graphviz: Putting a Caption on a Node In Addition to a Label - Stack Overflow Graphviz: Distinct colors for xlabel and nodelabel - Stack Overflow
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus