Skip to content

Remove extra arguments from WCSAxes draw() methods #12672

Closed

Description

@dstansby

In Matplotlib every draw() method has a two arguments, self and renderer. In WCSAxes this is not the case however, and there are frequently other arguments to draw(). This causes at least a couple of issues when interacting with Matplotlib, most recently #12568. It also reduces legibility of the code in my opinion - drawing an object should only rely on the state of that object at draw time, not any extra parameters.

I am therefore in the process of refactoring WCSAxes to remove extra arguments to the draw() methods. This is going to require quite a bit of surgery, so I'm opening this issue to track the progress I make and PRs I open.

draw() methods that need fixing:

PRs opened:
(note: these are all based on top of each other, so the order matters)

  1. Calculate WCSAxes TickLabel pixel coords at draw time #12630
  2. Deprecate getting/setting pix on WCSAxes Spine #13989
  3. Allow WCSAxes ticklabels to be rasterized #14760
  4. https://github.com/dstansby/astropy/tree/wcsaxes-axislbl-draw

Activity

  1. dstansby commented on Jan 10, 2024

    @dstansby
    ContributorAuthor

    All done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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