1.subplot和add_subplot的区别
他们两个参数一致
使用add_subplot需要先创建figure对象
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111)
使用subplot
import matplotlib.pyplot as plt
plt.subplot(111)
2.annotate()的参数
import matplotlib.pyplot as plt
"""
node_txt:节点的名字
xy:被注解东西的位置
xycoords:被注解位置是相对整个图形还是该坐标轴
xyText:注解内容的中心位置
textcooeds:
va:horizontal alignment:文本内容竖向对齐方式
ha:vertical alignment:文本内容横向对齐方式
arrowprops:标记线的形状,默认‘->’
bbox:设置方框
"""
ax1.annotate(u'decisionNode',
xy=(0.1, 0.5), xycoords='axes fraction',
xytext=(0.5, 0.1), textcoords='axes fraction',
va='center', ha='center',
bbox=decisionNode, arrowprops=arrow_args
)