| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
As a test, you can run: import matplotlib.pyplot as plt
from matplotlib._api import suppress_matplotlib_deprecation_warning
from matplotlib.widgets import Button, CheckButtons, RadioButtons
for useblit in [False, True]:
fig, axs = plt.subplots(10, 10, constrained_layout=True)
fig.suptitle(f'Button(useblit={useblit})')
fig._buttons = [
Button(ax, f'Test {i}', useblit=useblit)
for i, ax in enumerate(axs.flat)
]
for button_class in (CheckButtons, RadioButtons):
for useblit in [False, True]:
fig, axs = plt.subplots(10, 10, constrained_layout=True)
fig.suptitle(f'{button_class.__name__}(useblit={useblit})')
fig._buttons = [
button_class(ax, [f'Test {4*i+j}' for j in range(4)],
useblit=useblit)
for i, ax in enumerate(axs.flat)
]
for button in fig._buttons[::2]:
with suppress_matplotlib_deprecation_warning():
if isinstance(button, RadioButtons):
button.circles # Trigger deprecated behaviour.
else:
button.lines
plt.show()which for useblit=False takes seconds to refresh on click (or hover for plain Button), but is nearly instantaneous with useblit=True. |
Sorry, something went wrong.
|
Rebased to work with RadioButtons-as-scatter-plot, and also updated the above code to test both the old and new buttons. |
Sorry, something went wrong.
|
Looks good, but perhaps this should wait for #24474 to be merged first (and blitting adapted to the new checkboxes as well)? |
Sorry, something went wrong.
| if self.drawon: | ||
| self.ax.figure.canvas.draw() | ||
| if self._useblit: | ||
| self.ax.draw_artist(self.ax) |
There was a problem hiding this comment.
Can you confirm that Button doesn't use copy_from_bbox/restore_region like the other two widgets because the button covers the entire axes anyways?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, and it's strictly a rectangle, so copy_from_bbox/restore_region would effectively be directly overwritten immediately.
Sorry, something went wrong.
|
I also wonder if the default should be True like the new ToolHandles and Selectors were when useblit was added to them? |
Sorry, something went wrong.
|
Seems reasonable. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
PR Checklist
Tests and Styling
Documentation