1. 程式人生 > >matplot.pyplot中的註釋功能

matplot.pyplot中的註釋功能

def createPlot():
    fig = plt.figure(1,facecolor='white')
    fig.clf()
    treeNode = plt.subplot(111,frameon = False)
    treeNode.annotate('note',xy=(0.1,0.5),xycoords='axes fraction',xytext=(0.0,0.1),textcoords='axes fraction',va='center',ha='center',bbox=decisionNode,arrowprops=arrow_args)#
    treeNode.text(0.3,0.3,'test')
    plt.show()

createPlot()