vis.py 文件源码

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

项目:wradlib 作者: wradlib 项目源码 文件源码
def add_patches(ax, patch_array, **kwargs):
    """
    Add patches (points in the form Nx2) to axes


    Add patches (points in the form Nx2) to existing axes ax
    using :class:`matplotlib:matplotlib.collections.PolyCollection`.

    .. versionadded:: 0.6.0

    Parameters
    ----------
    ax : :class:`matplotlib:matplotlib.axes.Axes`
    patch_array : nested :class:`numpy:numpy.ndarray` Nx2 array(s)
    kwargs : :class:`matplotlib:matplotlib.collections.PolyCollection`

    Examples
    --------
    See :ref:`notebooks/visualisation/wradlib_overlay.ipynb`.
    """

    try:
        ax.add_collection(PolyCollection([patch_array], **kwargs))
    except AssertionError:
        ax.add_collection(PolyCollection([patch_array[None, ...]], **kwargs))
    except ValueError:
        for patch in patch_array:
            add_patches(ax, patch, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号