| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ``CallbackRegistry`` objects gain a method to temporarily block signals | ||
| ----------------------------------------------------------------------- | ||
|
|
||
| The context manager `~matplotlib.cbook.CallbackRegistry.blocked` can be used | ||
| to block callback signals from being processed by the ``CallbackRegistry``. | ||
| The optional keyword, *signal*, can be used to block a specific signal | ||
| from being processed and let all other signals pass. | ||
|
|
||
| .. code-block:: | ||
|
|
||
| import matplotlib.pyplot as plt | ||
|
|
||
| fig, ax = plt.subplots() | ||
| ax.imshow([[0, 1], [2, 3]]) | ||
|
|
||
| # Block all interactivity through the canvas callbacks | ||
| with fig.canvas.callbacks.blocked(): | ||
| plt.show() | ||
|
|
||
| fig, ax = plt.subplots() | ||
| ax.imshow([[0, 1], [2, 3]]) | ||
|
|
||
| # Only block key press events | ||
| with fig.canvas.callbacks.blocked(signal="key_press_event"): | ||
| plt.show() |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.