Use argparse; add rankdir parameter
If drawing a vertical graph, separate words with spaces

If drawing a horizontal graph, separate words with newlines, as before