MCPcopy Index your code
hub / github.com/wepe/MachineLearning / createPlot

Function createPlot

DecisionTree/treePlotter.py:64–74  ·  view source on GitHub ↗
(inTree)

Source from the content-addressed store, hash-verified

62#if you do get a dictonary you know it's a tree, and the first element will be another dict
63
64def createPlot(inTree):
65 fig = plt.figure(1, facecolor='white')
66 fig.clf()
67 axprops = dict(xticks=[], yticks=[])
68 createPlot.ax1 = plt.subplot(111, frameon=False, **axprops) #no ticks
69 #createPlot.ax1 = plt.subplot(111, frameon=False) #ticks for demo puropses
70 plotTree.totalW = float(getNumLeafs(inTree))
71 plotTree.totalD = float(getTreeDepth(inTree))
72 plotTree.xOff = -0.5/plotTree.totalW; plotTree.yOff = 1.0;
73 plotTree(inTree, (0.5,1.0), '')
74 plt.show()
75
76
77

Callers

nothing calls this directly

Calls 4

getNumLeafsFunction · 0.85
getTreeDepthFunction · 0.85
plotTreeFunction · 0.85
showMethod · 0.80

Tested by

no test coverage detected