clg.notebook.exportCLG

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

Export the clg as a picture.

Parameters:
  • clgdot (pydot.Dot) – pydot representation of the CLG.

  • filename (str) – The filename of the exported file.

  • 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.

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]
""")
import os

gclgnb.exportCLG(clg, "clg.svg")
os.path.exists("clg.svg")
# True