Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpanSelector span_stays fails with use_blit=True #5680

Closed
nedlrichards opened this issue Dec 15, 2015 · 1 comment
Closed

SpanSelector span_stays fails with use_blit=True #5680

nedlrichards opened this issue Dec 15, 2015 · 1 comment
Assignees
Milestone

Comments

@nedlrichards
Copy link

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()
@tacaswell tacaswell added this to the Critical bugfix release (1.5.1) milestone Dec 15, 2015
@tacaswell tacaswell self-assigned this Dec 15, 2015
@tacaswell
Copy link
Member

Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants