import networkx as nx
G = nx.DiGraph()
G.add_edge("A: test", 'B: test')
nx.write_dot(G,'so.dot')
Produces
This is due to the colon.
so.dot
:
strict digraph G {
A;
B;
"A: test" -> "B: test";
}
Notice it strips the colon and everything behind it.
If I manually change this to
strict digraph G {
"A: test";
"B: test";
"A: test" -> "B: test";
}
it's fine. In fact it doesn't matter if there are nodes, as long as there are edges.
If I remove the space between :
and t
, only A and B are generated.
I've tried escaping the colon in various ways, but that doesn't seem to work. I can manually delete the nodes every time, obviously, but a scripted solution would be preferable. (And not a second script that goes through the .dot file)
Anyone have an idea?