graphviz图太宽

时间:2018-10-10 06:36:57

标签: python jupyter graphviz

我正在练习在jupyter笔记本中使用graphviz创建决策树的练习。但是,决策树范围太广。这是代码:

from sklearn.tree import export_graphviz
export_graphviz(tree, out_file="tree.dot", class_names=["malignant", "benign"], 
                feature_names=cancer.feature_names, impurity=False, filled=True)
with open("tree.dot") as f:
    dot_graph = f.read()
display(graphviz.Source(dot_graph))

我得到这个: enter image description here

我必须滚动才能看到决策树的左侧。我可以减小宽度吗?怎么样?

0 个答案:

没有答案