Description
Currently, the signature of FigureCanvas subclasses is FigureCanvasFoo(figure)
, except for wx where it is FigureCanvasWx(parent, id, figure)
(#10606). These signatures appears to play not-so-nicely with a number of GUI builder tools (wxGlade, QtDesigner) which expect to be able to build such objects without passing in a Figure instance. For example, wxGlade and QtDesigner both expect (I believe) to be able to call FigureCanvas(parent)
, or perhaps(?) FigureCanvas(parent=parent)
(#10606 (comment), #11423), and likewise the third-party QtQuick backend (https://github.com/jmitrevs/matplotlib_backend_qtquick) patches the constructor to make the figure
parameter optional.
It would seem safe enough to make figure
optional in the base class (and all subclasses) and just construct a new Figure instance if none is passed. It would also be nice to check what are exactly the signature requirements for the various GUI builders, and whether similar changes need to be done for Toolbar classes.