Skip to content

Inconsistent inset axes size when using transform='axes' with different projections #751

Description

@gepcel

Description

When creating a figure with two subplots using different projections (e.g., cart and cyl) and adding inset axes with identical relative bounding boxes (transform='axes'), the resulting inset axes have inconsistent physical sizes.

Since transform='axes' specifies the inset position and size as a fraction of the parent axes, the insets should visually occupy the same proportion of their respective parent axes, regardless of the parent's projection.

Example

fig,ax=pplt.subplots(ncols=2, nrows=1, proj=['cart', 'cyl'], share=False)
ax[0].format(xlim=(0,1),ylim=(0,1))
ax[1].format(lonlim=(0,1),latlim=(0,1),labels=True)
ax[0].inset([.7, .0, .3, .3], transform='axes')
ax[1].inset([.7, .0, .3, .3], transform='axes', proj='cyl')

Expected Behavior

Both inset axes should have the exact same relative size and shape within their respective parent axes, as they are defined by the same [left, bottom, width, height] parameters in axes coordinates.

Actual Behavior

The inset axes appear to have different physical sizes on the rendered figure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions