How to use the mplcursors._mplcursors.Cursor function in mplcursors

To help you get started, we’ve selected a few mplcursors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github anntzer / mplcursors / mplcursors / _convenience.py View on Github external
artists_or_axes = [ax
                           for fig in map(plt.figure, plt.get_fignums())
                           for ax in fig.axes]
    elif not cbook.iterable(artists_or_axes):
        artists_or_axes = [artists_or_axes]
    artists = []
    for entry in artists_or_axes:
        if isinstance(entry, Axes):
            ax = entry
            artists.extend(ax.lines + ax.patches + ax.collections + ax.images)
            for container in ax.containers:
                artists.extend(container)
        else:
            artist = entry
            artists.append(artist)
    return Cursor(artists, **kwargs)