points.py 文件源码

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

项目:pyhiro 作者: wanweiwei07 项目源码 文件源码
def plot_points(points, show=True):    
    import matplotlib.pyplot as plt

    points = np.asanyarray(points)
    dimension = points.shape[1]    
    if dimension == 3:
        fig = plt.figure()
        ax  = fig.add_subplot(111, projection='3d')
        ax.scatter(*points.T)
    elif dimension == 2:
        plt.scatter(*points.T)
    else:
        raise ValueError('Points must be 2D or 3D, not %dD', dimension)

    if show: 
        plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号