finesse.plotting.graph.graphviz_draw¶
- finesse.plotting.graph.graphviz_draw(model=None, network=None, draw_labels=True, angle=0, overlap=True, ratio=0.45, edge_len=1.0, size=(13, 7), pad=(0.0, 0.0), format='svg', maxiter=500, layout='neato', mode='sgd')[source]¶
This should get merged with plot_graphviz at some point.
Draws a |graphviz| figure using |neato| layout. The default settings are tested to produce a passable drawing of the aLIGO DRMI graph.
- Parameters
- anglefloat or bool
The angle parameter rotates the graph by |angle| degrees relative to the first edge in the graph, which most of the time is the edge coming out of the laser. Set |angle=False| to disable rotation and let graphviz decide how to rotate the graph.
- overlapbool or str
Setting for how graphviz deals with node overlaps. Set to False for graphviz to attempt to remove overlaps. Note that overlap removal runs as a post-processing step after initial layout and usually makes the graph look worse.
- ratiofloat
Post processing step to stretch the graph. Used for stretching horizontally to compoensate for wider nodes to fit node labels.
Notes
The svg format sometimes crops the image too hard, which results in clipped nodes or edges, if that happens increase the |pad| graph_attr or use the |png| format.
Examples
import finesse.ligo import finesse.plotting kat = finesse.ligo.make_aligo() finesse.plotting.graph.graphviz_draw(kat)