CPDAG.toDot
- CPDAG.toDot(*args)
The chain components (nodes linked by undirected edges) are drawn in clusters (color of the key
dot.chainComponentBgColorofpyagrum.config) and the compelled arcs with the color of the keydot.compelledArcColor.- Parameters:
options (
pyagrum.DotOptions, optional) – what is given to the drawing beyond the look ofpyagrum.config(size, label, colors of some nodes and arcs…); a color given for an arc wins over the color of the compelled arcs.- Returns:
a representation of the CPDAG in the DOT format
- Return type:
str
Example
import pyagrum as gum
cpdag = gum.CPDAG.fromDAG(gum.fastDAG("A->B->C;D->C"))
dot = cpdag.toDot()
"cluster" in dot # the chain component {A, B}
# True
print("\n".join(line for line in dot.splitlines() if " -> " in line))
# 1 -> 2 [color="red"];
# 3 -> 2 [color="red"];
# 0 -> 1 [dir="none"];
Class
Overridden in