首页 > 解决方案 > python:graphviz不显示更大或更小的标记

问题描述

下图中的这个问题。在 Windows 10 操作系统中。和 jupyter 笔记本。和版本 python 3.8。使用 graphviz 创建图像。

图形可视化

在红色标记的地方。它应该显示一个更大的迹象。在 jupyter notebook 中编写 python 代码。

import sklearn.datasets as datasets
import pandas as pd
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split

from sklearn.externals.six import StringIO  
from IPython.display import Image  
from sklearn.tree import export_graphviz
import pydotplus
dtree=DecisionTreeClassifier(max_depth=2)
dtree.fit(X_train,y_train)

dot_data = StringIO()
export_graphviz(dtree, out_file=dot_data, filled=True, rounded=True, 
special_characters=True, feature_names=X_train.columns)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())  
Image(graph.create_png())

请帮我。

标签: pythonpython-3.xjupyter-notebookgraphviz

解决方案


您没有显示您的 python 代码,但这直接在点中起作用:

digraph "le" {
  le [label="look ≤ here"]
}

推荐阅读