File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,12 @@ def dag_to_dot(
201201 >>> e = DAGNode("e", step=3, parents=[d])
202202 >>> dag_graph = dag_to_dot(a)
203203
204+ Display image directly without saving (requires IPython)
205+
206+ >>> from IPython.display import Image, display
207+ >>> plt = Image(dag_graph.create_png())
208+ >>> display(plt)
209+
204210 Export to image, dot file, etc.
205211
206212 >>> dag_graph.write_png("tree_dag.png")
Original file line number Diff line number Diff line change @@ -640,6 +640,12 @@ def tree_to_dot(
640640 >>> e = Node("e", age=35, parent=b)
641641 >>> graph = tree_to_dot(root)
642642
643+ Display image directly without saving (requires IPython)
644+
645+ >>> from IPython.display import Image, display
646+ >>> plt = Image(graph.create_png())
647+ >>> display(plt)
648+
643649 Export to image, dot file, etc.
644650
645651 >>> graph.write_png("tree.png")
You can’t perform that action at this time.
0 commit comments