Skip to content

[MNT]: MultiCursor should not take canvas as first parameter #21496

@QuLogic

Description

@QuLogic

Summary

During the sprint, we were looking at widgets, and I noticed that the MultiCursor constructor takes a FigureCanvasBase as first parameter. This probably exists to say where to connect signals, but this does not match how any of the other widgets work, which infer this from the supplied Axes. Theoretically, I don't see any reason why the Axes need to be on a single Figure for MultiCursor to work, but that's implied by it only using a single canvas.

Proposed fix

The canvas should be found from the Axes, and the constructor should assert that all supplied Axes are on the same Figure (if that is indeed required.)

However, I don't know how to deprecate this. If we use _api.delete_parameter, then the remaining parameters become keyword-only, but we don't want to do that to the Axes parameter, which should have been the first positional parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions