Last active
October 31, 2017 22:27
-
-
Save weibeld/1b8d88256c4f204c1a11fcdf4c5e5286 to your computer and use it in GitHub Desktop.
A small Graphviz "Hello World" program
This file contains hidden or 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
// A small Graphviz "Hello World" program | |
// | |
// Usage: | |
// | |
// dot -Tpdf graphviz.dot >out.pdf | |
// | |
// See all supported output formats with: | |
// | |
// dot -Txxx | |
// | |
// Alternative layout algorithms: neato, fdp, twopi, circo (instead of dot) | |
// | |
// Daniel Weibel <[email protected]> 14 March 2014 | |
//----------------------------------------------------------------------------// | |
// A small finite state machine (FSM) | |
digraph fsm { | |
// Graph attributes | |
rankdir=LR; | |
// Node attributes | |
start [shape=plaintext]; | |
1 [shape=doublecircle]; | |
0 [label="¬p\n¬q"]; | |
node [shape=circle]; | |
// Edges and edge attributes | |
start -> 0; | |
0 -> 0 [label = "a,b"]; | |
0 -> 1 [label = "b"]; | |
1 -> 1 [label = "b"]; | |
1 -> 2 [label = "a"]; | |
2 -> 2 [label = "a,b"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment