Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SpanSelector span_stays fails with use_blit=True #5680

Copy link
Copy link
Closed
@nedlrichards

Description

@nedlrichards
Issue body actions

I am writing a really simply GUI to select an range of x values on a number of plots simultaneously. I would like the selection for each sub-plot to stay on the plot until the user has finished selected a span on each channel and exits the GUI.

The flag span_stays=True does not work with use_blit=True. It does work with use_blit=False. The performance hit isn't too bad as far as I can tell.

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

test_data = np.random.randn(1000, 1000)

fig, ax = plt.subplots()

ax.imshow(test_data)

def selection(x1, x2):
    """This function isn't the point"""
    pass

#uncommenting useblit makes span_stays stop working
span = SpanSelector(ax, selection, 'horizontal', #useblit=True,
                    rectprops=dict(alpha=0.5, facecolor='red'), span_stays=True)

plt.show()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.