clg.notebook.CLG2dot

pyagrum.clg.notebook.CLG2dot(clg, *, size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)

create a pydot representation of the CLG

Parameters:
  • clg (CLG) – Conditional Linear Gaussian.

  • size (str) – Size of the rendered graph.

  • nodeColor (dict[Tuple(int,int),float]) – A nodeMap of values to be shown as color nodes (with special color for 0 and 1).

  • arcWidth (dict[Tuple(int,int),float]) – An arcMap of values to be shown as bold arcs.

  • arcColor (dict[Tuple(int,int),float]) – An arcMap of values (between 0 and 1) to be shown as color of arcs.

  • cmapNode (ColorMap) – Color map to show the vals of Nodes.

  • cmapArc (ColorMap) – Color map to show the vals of Arcs.

  • showMsg (dict) – A nodeMap of values to be shown as tooltip.

Returns:

The desired representation of the Conditional Linear Gaussian.

Return type:

pydot.Dot

Example

import pyagrum.clg as gclg
import pyagrum.clg.notebook as gclgnb

clg = gclg.SEM.toclg("""
A = 2[1]
B = 1 + 0.5A[2]
C = 3 + B[1]
""")
g = gclgnb.CLG2dot(clg)  # a pydot graph
sorted(n.get_name().strip('"') for n in g.get_nodes() if n.get_name() not in ("node", "edge", "graph"))
# ['A', 'B', 'C']