-
-
Save anonymous/c0d25fa7fad6ac7a1be6 to your computer and use it in GitHub Desktop.
Issue attachments for pydot/pydot-ng#80: https://github.com/pydot/pydot-ng/issues/80
This file contains 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
import pydot | |
g = pydot.graph_from_dot_data("digraph G {1 -> 2;}") | |
print("Simple DOT:\n{0}".format(g.to_string())) | |
print("Nodes: {0}, edges: {1}".format(len(g.get_nodes()), len(g.get_edges()))) | |
g.write_png("simple.png") | |
g.set_node_defaults(style="filled", fillcolor="yellow") | |
print("DOT with yellow fill (wrong):\n{0}".format(g.to_string())) | |
g.write_png("simple.yellow.png") | |
g = pydot.graph_from_dot_data(""" | |
digraph G { | |
node [style=filled, fillcolor=yellow]; | |
1 -> 2; | |
} | |
""") | |
print("DOT with yellow fill (good):\n{0}".format(g.to_string())) | |
g.write_png("simple.good.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment