I'm writing a tiny toy project involving automata, which was a good excuse to learn the dot language finally. I used GraphViz couple of times before and was very fond of it. After trying out several approaches I decided to put down all things I needed in order to get my automata graphs render as needed. These were:
- Print the epsilon character.
- Switch the orientation to horizontal (it's vertical by default).
- Render a double circle node.
- Render several graphs in a single plot.
- Have invisible nodes.
- Have invisible edges.

Having all this before my eyes, it became obvious that the only way to learn how to do it is by example, which is exactly what entered in google. I found this amazing flickr set with examples addressing almost all my problems. So here are the answers:
- Print the epsilon character.
- You can use html entities in your labels
- Switch the orientation to horizontal.
- Pass the directive rankdir=LR
- Render a double circle node.
- node [shape=doublecircle]
- Render several graphs in a single plot.
- This one was actually not a problem at all - if your nodes don't connect, you get an unconnected graph
- Have invisible nodes.
- node [shape=plaintext label=""]
- Have invisible edges.
- edge [style=invis]
So, the presentation's ready. Time to start writing the algorithm :)
1 comment:
Thanks a bunch!
Post a Comment