Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Closer-to-native signatures for native canvas and toolbar classes #17349

Copy link
Copy link
Closed
@anntzer

Description

@anntzer
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.