Bug report
Bug summary
Before the refactor, one would set colorbar axes to be pickable with colorbar.ax.set_picker(True). Now, it is necessary to use the undocumented colorbar.ax.inner_ax.set_picker(True). Likewise, with motion notify events, MouseEvent.inaxes is not colorbar.ax under any circumstances, it always is colorbar.ax.inner_ax.
But, this is not really about events so much as the fact that Colorbar(ax).ax is ax == False and all methods of colorbar.ax are actually bound to a different object, namely colorbar.ax.inner_ax, so they are acting on surprising, hidden state (from a user's perspective).
We could work around the events issue, but I feel like there would be an ongoing stream of bug reports without a comprehensive fix. On the other hand, I definitely don't want to revert ColorbarAxes entirely because I really like the improvements that it enabled.
Code for reproduction
Please see #20471, which this issue blocks (in my opinion).
Matplotlib version
- Operating system: Win10
- Matplotlib version (
import matplotlib; print(matplotlib.__version__)): master
- Matplotlib backend (
print(matplotlib.get_backend())): tkagg
- Python version: 3.8.8
- Jupyter version (if applicable):
- Other libraries:
cc @jklymak
Bug report
Bug summary
Before the refactor, one would set colorbar axes to be pickable with
colorbar.ax.set_picker(True). Now, it is necessary to use the undocumentedcolorbar.ax.inner_ax.set_picker(True). Likewise, with motion notify events,MouseEvent.inaxesis notcolorbar.axunder any circumstances, it always iscolorbar.ax.inner_ax.But, this is not really about events so much as the fact that
Colorbar(ax).ax is ax == Falseand all methods ofcolorbar.axare actually bound to a different object, namelycolorbar.ax.inner_ax, so they are acting on surprising, hidden state (from a user's perspective).We could work around the events issue, but I feel like there would be an ongoing stream of bug reports without a comprehensive fix. On the other hand, I definitely don't want to revert
ColorbarAxesentirely because I really like the improvements that it enabled.Code for reproduction
Please see #20471, which this issue blocks (in my opinion).
Matplotlib version
import matplotlib; print(matplotlib.__version__)): masterprint(matplotlib.get_backend())): tkaggcc @jklymak