0

我有定义桥梁开口形状的数据。我开发的代码用水平线切割桥梁开口,就好像它是水位一样,包括桥墩和墙壁上的交点。我想确保形状始终是边界形状而不是对角线切割。当我使用排序并绘制数据时,我得到一个 Zig Zaw 形状......所以我从另一个进程获得的坐标序列是 A,我需要的序列是 B......?如何确保左侧和右侧的垂直点是避免 Zig Zaw 的序列?

def Plot_Poly(Poly):
    """
    PLOTS THE DATA From the XS Files
    """
    import matplotlib.pyplot as plt

    #============ PLOT ROUTINE FOR CROSS SECTIONS ==============
    print 'About to Plot'
    plt.clf() # Clear any Previous Plots...
    plt.ylabel('Station Elevation (mAHD)')
    plt.xlabel('Station Distance (m)')
    plt.plot([row[0] for row in Poly],[row[1] for row in Poly],marker='o',linestyle='--',dashes=(5,10))  # Plot the Time Series
    plt.show()
    return()


A = [[0,0.95],[0,0],[1,0.95],[1,0.0],[2,0.95],[2,0],[3,0.95],[3,0.0],[4.0,0.95],[4,0],[5,0.95],[5,0.0]]
Plot_Poly(A)
B = [[0,0.95],[0,0],[1,0],[1,0.95],[2,0.95],[2,0],[3,0],[3,0.95],[4.0,0.95],[4,0],[5,0],[5,0.95]]
Plot_Poly(B)
4

0 回答 0