MCPcopy Create free account
hub / github.com/Jack-Cherish/Machine-Learning / plotNode

Function plotNode

Decision Tree/Decision Tree.py:254–259  ·  view source on GitHub ↗
(nodeTxt, centerPt, parentPt, nodeType)

Source from the content-addressed store, hash-verified

252 2017-07-24
253"""
254def plotNode(nodeTxt, centerPt, parentPt, nodeType):
255 arrow_args = dict(arrowstyle="<-") #定义箭头格式
256 font = FontProperties(fname=r"c:\windows\fonts\simsunb.ttf", size=14) #设置中文字体
257 createPlot.ax1.annotate(nodeTxt, xy=parentPt, xycoords='axes fraction', #绘制结点
258 xytext=centerPt, textcoords='axes fraction',
259 va="center", ha="center", bbox=nodeType, arrowprops=arrow_args, FontProperties=font)
260
261"""
262函数说明:标注有向边属性值

Callers 1

plotTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected