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: Literal['png', 'svg'] = 'svg', maxiter=500, layout='neato', mode='sgd', path=None, show=True)[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.

pathPath or None

Save the resulting image to the given path. Defaults to None, which saves in a temporary file that is displayed if ‘show’ is set to True.

showbool, optional

Whether to show the resulting image. In Jupyter environments, shows the plot inline, otherwise opens a webbrowser for svgs and PIL for pngs. Defaults to True.

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.