util.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:prysm 作者: brandondube 项目源码 文件源码
def make_segments(x, y):
    '''
    Create list of line segments from x and y coordinates, in the correct format for LineCollection:
    an array of the form   numlines x (points per line) x 2 (x and y) array
    '''

    points = np.array([x, y]).T.reshape(-1, 1, 2)
    segments = np.concatenate([points[:-1], points[1:]], axis=1)

    return segments
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号