Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inset_axes zooms doesn't show lines #437

Open
singledoggy opened this issue Sep 17, 2023 · 0 comments
Open

Inset_axes zooms doesn't show lines #437

singledoggy opened this issue Sep 17, 2023 · 0 comments

Comments

@singledoggy
Copy link

Description

inset_axes doesn't show lines.
This may related to #133.

Steps to reproduce

import cartopy.crs as ccrs
import matplotlib as mpl
import proplot as pplt
from mpl_toolkits.axes_grid1.inset_locator import mark_inset

pplt.rc.reso = "med"

extents_main = [70, 140, 10, 60]
lon_min, lon_max, lat_min, lat_max = extents_main
crs = ccrs.PlateCarree()
fig, axs = pplt.subplots(
    nrows=1, ncols=1, share=False, projection=crs,
)

ax = axs[0]
axs.format(
    lonlim=(lon_min, lon_max),
    latlim=(lat_min, lat_max),
    lonlabels="b",
    latlabels="l",
   # abc=True,
)

for ax in axs:

    ax_sub = ax.inset_axes(
        (130, 10, 10, 10),
        transform=axs.transData,
        projection=crs,
        zoom='True',
        zoom_kw={'ec': 'red', 'lw': 2}
    )

#    if use mark_inset, we can see the lines
#    mark_inset(ax, ax_sub, loc1=1, loc2=3, ec="red",ls= "--", lw=1.5)

    ax_sub.format(
        grid=False,
        lonlim=(110, 120),
        latlim=(35, 45),
        color="red",
        linewidth=1.5,
        ticklabelweight="bold",
    )

Expected behavior:

image

Actual behavior:

image

Quick fix

#    if use mark_inset, we can see the lines
mark_inset(ax, ax_sub, loc1=1, loc2=3, ec="red",ls= "--", lw=1.5)

Maybe the default zoom can be get by mark_inset?

Proplot version

Paste the results of import matplotlib; print(matplotlib.version); import proplot; print(proplot.version) here.
3.4.3
0.9.5.post360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant