I try to create a flow chart whereof I want to change the colors of the nodes. The code of the first flow chart that I created was:
import graphviz
d=graphviz.Digraph()
d.edge('hello','world')
d.edge('new','hello')
d
It works perfectly: simple_flow_chart Although I can not find how to change the colors of the nodes. I tried a few things but it doesn't work. So I tried something else:
digraph {
a -> b;
b -> c;
c -> d;
d -> a;
}
With this code I should be able to change the colors of the nodes if I am correct. But this code gives me a SyntaxError:
File "<ipython-input-46-3bef7a6868e5>", line 1
digraph {
^
SyntaxError: invalid syntax
So an error on the '{', but I don't know why.
Maybe I'm mixing stuff up here. But I'm getting lost. Is there a way to color the nodes with the first code? If not, how do I get the second code working and how do I then color the nodes? Note: Graphviz 2.38 was installed on my Windows computer and the path was added to the environment variables. Every help is appreciated.