軌跡

1二次元入力リスト、出力軌跡。

インポートPLTのAS matplotlib.pyplot
 点が特徴描く、機能、実装、二次元軌跡入力リストを-defined 
DEFの:track_pic(SPOT)
    二つの方法 
    L = lenを(SPOT)
    図、AXS = plt.subplots()
     = plt.figure図() 
    AXS = fig.add_subplot(111)
    のための I における範囲(1-L。 ):
         各撮影2 
        A SPOT = [I:I + 2 ] 
        X1、Y1 = A [0] 
        X2、Y2 = [1 ]
         終了点を開始点からの接続を制御すること
        connectionstyle = "angle3、angleA = 90、0 = angleB"
        axs.plot([X1、X2]、[Y1、Y2]、" " 
        axs.annotate("" 、 注释为空 
                    XY =(X2、Y2)、xycoords = ' データ' 
                    xytext =(X1、 Y1)、textcoords = ' データ' 
                    arrowprops = dictの(
                                    矢のスタイル(arrowstyle) = " - > "、カラー= " 0.5 " 
                                    shrinkA = 5、shrinkB = 5
                                    PATCHA =なし、patchB = なし、
                                     connectionstyle = connectionstyle、 
                                    )、 
    plt.show()
スポット = [20,20]、[3,4]、[5,60]、[7,86]、[9,100 ] 
track_pic(スポット =スポット)
コードの表示

TTT

参考:https://matplotlib.org/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py

        

おすすめ

転載: www.cnblogs.com/xxswkl/p/12163365.html