Skip to content

Question regarding static graph #152

Closed Answered by formersbach
himoto asked this question in Q&A
Discussion options

You must be logged in to vote

Yes it's possible, although somewhat tedious.
You will have to define the shape of each node individually. You can get a list of nodes using:

model = create_model('path.to.model')
model.to_graph()
G = model.graph
G.nodes

Then each node can be edited using:

n = G.get_node('nodename')
n.attr["shape"] = "triangle"

#Equivalent to using "-Nshape=paralellogram" in static_plot() :
for node in G.nodes:
    n = G.get_node[node]
    n.attr["shape"] = "paralellogram"

Detailed available attributes can be found in graphviz doc and pygraphviz doc.
Hope this answers your question!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@himoto
Comment options

himoto Jul 21, 2022
Maintainer Author

Answer selected by himoto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested graph Graph visualization
2 participants