Skip to content

Commit b9d16b2

Browse files
authored
Merge pull request scikit-learn#7342 from themrmax/pydotplus-decision-tree-plotting
change decision tree example to use pydotplus
2 parents 287a329 + fed401c commit b9d16b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/modules/tree.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ supported file type): ``dot -Tpdf iris.dot -o iris.pdf``.
140140
>>> import os
141141
>>> os.unlink('iris.dot')
142142

143-
Alternatively, if we have Python module ``pydot`` installed, we can generate
143+
Alternatively, if we have Python module ``pydotplus`` installed, we can generate
144144
a PDF file (or any other supported file type) directly in Python::
145145

146146
>>> from sklearn.externals.six import StringIO # doctest: +SKIP
147-
>>> import pydot # doctest: +SKIP
147+
>>> import pydotplus # doctest: +SKIP
148148
>>> dot_data = StringIO() # doctest: +SKIP
149149
>>> tree.export_graphviz(clf, out_file=dot_data) # doctest: +SKIP
150-
>>> graph = pydot.graph_from_dot_data(dot_data.getvalue()) # doctest: +SKIP
150+
>>> graph = pydotplus.graph_from_dot_data(dot_data.getvalue()) # doctest: +SKIP
151151
>>> graph.write_pdf("iris.pdf") # doctest: +SKIP
152152

153153
The :func:`export_graphviz` exporter also supports a variety of aesthetic
@@ -162,7 +162,7 @@ render these plots inline using the `Image()` function::
162162
class_names=iris.target_names, # doctest: +SKIP
163163
filled=True, rounded=True, # doctest: +SKIP
164164
special_characters=True) # doctest: +SKIP
165-
>>> graph = pydot.graph_from_dot_data(dot_data.getvalue()) # doctest: +SKIP
165+
>>> graph = pydotplus.graph_from_dot_data(dot_data.getvalue()) # doctest: +SKIP
166166
>>> Image(graph.create_png()) # doctest: +SKIP
167167

168168
.. only:: html

0 commit comments

Comments
 (0)