home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 327101646

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
327101646 MDU6SXNzdWUzMjcxMDE2NDY= 2192 Subplots overlap each other using plot() and cartopy 22245117 closed 0     1 2018-05-28T19:20:52Z 2023-04-28T09:06:22Z 2023-04-28T09:06:22Z CONTRIBUTOR      

When subplots are narrow (e.g., small lon range and large lat range), they overlap each other. I'm not sure, but I think that box-forced in ax.set_aspect('equal', 'box-forced') would fix the problem (#1397). However, box-forced is deprecated since Matplotlib 2.2 and I can't figure out how to fix this.

python import xarray as xr import cartopy.crs as ccrs python ds = xr.tutorial.load_dataset('air_temperature') ds = ds.sel(lon = slice(250, 300)) air = ds['air'] transform = ccrs.PlateCarree() projection = ccrs.Mercator(air.lon.values.mean(), air.lat.values.min(), air.lat.values.max()) python p = air.isel(time=[0,1]).plot(transform = transform, aspect = ds.dims['lon']/ds.dims['lat'], col = 'time', col_wrap = 1, subplot_kws = {'projection': projection}) for ax in p.axes.flat: ax.set_extent((air.lon.values.min(), air.lon.values.max(), air.lat.values.min(), air.lat.values.max()), crs = transform) ax.set_aspect('equal', 'box-forced')

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.5.final.0 python-bits: 64 OS: Linux OS-release: 3.10.0-514.21.2.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: None LOCALE: None.None xarray: 0.10.4 pandas: 0.20.2 numpy: 1.12.1 scipy: 0.19.1 netCDF4: 1.2.4 h5netcdf: 0.5.1 h5py: 2.7.0 Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: 0.15.2 distributed: 1.18.1 matplotlib: 2.2.2 cartopy: 0.16.0 seaborn: 0.7.1 setuptools: 39.1.0 pip: 9.0.1 conda: 4.5.4 pytest: 3.1.2 IPython: 6.1.0 sphinx: 1.6.2
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2192/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.564ms · About: xarray-datasette