Skip to content

Axis sharing doesn't work for geo-axis #178

Description

@zxdawn

Description

span and share don't work for geographic axis.

Steps to reproduce

importproplotasplotf, axs=plot.subplots(nrows=2, ncols=2,
spany=3, sharey=3,
proj='lcc', proj_kw={'lon_0': 116}
)
axs.format(coast=True,
latlines=1, lonlines=1,
labels=True,
lonlim=(113, 119),
latlim=(37, 41.5),
)

Expected behavior:
matplotlib_shareproj

Lat labels are shared.

Actual behavior:
cartopy_share

Equivalent steps in matplotlib

importmatplotlib.pyplotaspltimportcartopy.crsasccrsproj=ccrs.LambertConformal(central_longitude=116)
fig, axs=plt.subplots(nrows=2, ncols=2,
subplot_kw={'projection': proj})
foridx,axinenumerate(axs.flatten()):
ax.set_extent([113, 119, 37, 41.5], ccrs.PlateCarree())
gl=ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,
color='gray', alpha=0.5, linestyle='--',
x_inline=False, y_inline=False)
gl.xlabels_top=Falsegl.ylabels_right=Falseifidx%2!=0:
gl.ylabels_left=Falseax.coastlines()

Proplot version

0.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions