Skip to content

Better handling of transform= in display functions #433

@bmcfee

Description

@bmcfee

This came up in a copilot review of #425 , but the way we're propagating the transform= parameter to vspan construction (and others) is maybe a little clumsy:

if base is None and height is None:
# If neither are provided, we'll use axes coordinates to span the figure
base, height = 0, 1
transform = ax.get_xaxis_transform()
elif base is not None and height is not None:
# If both are provided, we'll use data coordinates
transform = None

We could instead populate a second kwargs dict with transform (when base and height are None), or leave it empty (otherwise). This way transform can be supplied by the user and not be overridden by our transform inference.

I don't expect this will matter very much in practice, but it would be slightly cleaner to allow this behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions