FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: Slow lasso selector over QuadMesh collection · Issue #22520 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: Slow lasso selector over QuadMesh collection #22520

Description

Bug summary

When I create pcolormesh plot with big enough data, lasso selector (useblit=True) is redrawing very slowly. Don't have problem with this in version 3.4.2

Code for reproduction

import numpy as np
from matplotlib.widgets import LassoSelector
import matplotlib.pyplot as plt

class SelectFromCollection:
    def __init__(self, ax):
        self.lasso = LassoSelector(ax, onselect=self.onselect, useblit=True)
    def onselect(self, verts):
        pass


if __name__ == '__main__':
    fig, ax = plt.subplots()

    np.random.seed(19680801)
    Z = np.random.rand(1095, 100)
    x = np.arange(-0.5, 100, 1)  # len = 11
    y = np.arange(4.5, 1100, 1)  # len = 7

    ax.pcolormesh(x, y, Z)
    # data2d = np.random.randint(0, 100,(1000,1000))
    # ax.imshow(data2d)
    selector = SelectFromCollection(ax)
    plt.show()

Actual outcome

Slow lasso drawing

Expected outcome

Quick lasso drawing :)

Additional information

If imshow is used, lasso selector is acting normaly.

Operating system

Ubuntu 20.04

Matplotlib Version

3.5.1

Matplotlib Backend

QtAgg

Python version

3.8

Jupyter version

No response

Installation

No response

Activity

  1. QuLogic commented on Feb 24, 2022

    Member

    Is it really the lasso selector that's the problem, or is it something like #21917?

  2. jklymak commented on Mar 23, 2022

    Member

    I think this is the same as #21917, but I don't think that the fix in #21917 fixed the problem for zoom.

  3. jklymak commented on Mar 23, 2022

    Member

    This bisects to d9bb0a2 , #19908

  4. added this to the v3.5.2 milestone on Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL