Skip to content

Support inset_axes zooms for all GeoAxes projections #133

@zxdawn

Description

@zxdawn

Description

inset_axes doesn't work for geographic plots.

Steps to reproduce

import proplot as plot

f, axs = plot.subplots(
    ncols=2, axwidth=2.5,
    proj='robin', proj_kw={'lon_0': 180}
)
axs.format(
    suptitle='Figure with single projection',
    coast=True, latlines=30, lonlines=60
)

axi = axs.inset(
    [0, 0, 10, 10], transform='data', zoom=True,
    zoom_kw={'color': 'red3', 'lw': 2}
)

Error

Traceback (most recent call last):
  File "test_del.py", line 16, in <module>
    zoom_kw={'color': 'red3', 'lw': 2}
  File "/yin_raid/xin/miniconda3/envs/python37/lib/python3.7/site-packages/proplot/subplots.py", line 217, in _iterator
    ret.append(func(*args, **kwargs))
  File "/yin_raid/xin/miniconda3/envs/python37/lib/python3.7/site-packages/proplot/axes.py", line 1334, in inset_axes
    bb = locator(None, None)
  File "/yin_raid/xin/miniconda3/envs/python37/lib/python3.7/site-packages/proplot/axes.py", line 348, in inset_locator
    bb = mtransforms.TransformedBbox(bbox, trans)
  File "/yin_raid/xin/miniconda3/envs/python37/lib/python3.7/site-packages/matplotlib/transforms.py", line 1005, in __init__
    raise ValueError("'transform' must be an instance of "
ValueError: 'transform' must be an instance of 'matplotlib.transform.Transform'

Proplot version

0.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions