Fix Wx inconsistencies#10518
Conversation
| } | ||
|
|
||
|
|
||
| class SubplotToolWX(wx.Frame): |
There was a problem hiding this comment.
API changes (even for "apparently unused" stuff) should nearly always go through a deprecation period unless it's really too hard to keep around. Just decorate the class with @deprecated("2.2").
| filetypes = FigureCanvasAgg.filetypes | ||
|
|
||
|
|
||
| @cbook.deprecated("2.2") |
There was a problem hiding this comment.
Please leave until 3.0 (one minor-release deprecation period at least, usually two).
There was a problem hiding this comment.
I don't see that any other NavigationToolbar2 is deprecated, especially not the wx non-Agg one.
With the derived class removed and the modified import NavigationToolbar2Wx as NavigationToolbar2WxAgg things are consistent again (no deprecation).
Not having the Toolbar alias in backend_wxagg can break things, though.
There was a problem hiding this comment.
Having a deprecation for the Toolbar alias would require to replace the assignment Toolbar = NavigationToolbar2Wx with a derived and deprecated class. I would now be in favor of having this in wx and wxagg. What do you think?
There was a problem hiding this comment.
derived deprecated class sounds good to me.
There was a problem hiding this comment.
Thanks. Done, incl. alternatives in deprecation messages.
| from .backend_wx import ( | ||
| _BackendWx, _FigureCanvasWxBase, FigureFrameWx, NavigationToolbar2Wx) | ||
| from .backend_wx import _BackendWx, _FigureCanvasWxBase, FigureFrameWx | ||
| from .backend_wx import NavigationToolbar2Wx as NavigationToolbar2WxCairo |
There was a problem hiding this comment.
can go in the previous line (would prefer this) as
from .backend_wx import (
_BackendWx, _FigureCanvasWxBase, FigureFrameWx,
NavigationToolbar2Wx as NavigationToolbar2WxCairo)
There was a problem hiding this comment.
Done, also for wxagg.
|
"Release critical" together with PR #10428, to have working wx backends. |
Backport PR #10518 on branch v2.2.x
PR Summary
From discussion at PR 10428:
The wx examples in master are currently not consistent with the recent changes around NavigationToolbar2.
This PR makes NavigationToolbar2 consistent through the three wx backends.
Examples are adjusted to be similar to the documentation example at https://matplotlib.org/users/navigation_toolbar.html
The unused and undocumented class
SubplotToolWXhas been removed (Google did not find any code using this.)PR Checklist