plt.figure(1, figsize=(8,8))
ax = plt.subplot(111)
def drawNode(text, startX, startY, endX, endY, ann):
#绘制带箭头的文本...connectionstyle="arc3"),
bbox=dict(boxstyle="square", fc="r")
)
#在箭头中间位置标记数字...ax.text((startX+endX)/2, (startY+endY)/2, str(ann))
#绘制树根
bbox_props = dict(boxstyle="square,pad...=0.3", fc="cyan", ec="b", lw=2)
ax.text(0.5, 0.97, 'A', bbox=bbox_props)
#绘制其他节点
drawNode('B', 0.5, 0.97