-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Spurious lines of the pcolormesh example #5901
Comments
Thanks for flagging this @zxdawn! 😕 We should probably work out whether this is happening because of something we did or something When did this start? I wonder if there is an easy way to see all the previous editions of xarray's documentation - might help us quickly narrow down which version first had this issue? |
BTW, the question on StackOverflow, which was raised by @gerritholl a long time ago, looks similar. I'm not sure whether this is the cartopy issue, CC @QuLogic, and @greglucas. |
@TomNicholas I checked the doc and this issue begins from v0.16.1. Note that there're also small spurious lines after v0.10.9. Before v0.10.9, the figure looks fine. It's may be also related to matplotlib ... CC @jklymak and @timhoffm. |
Have you tried with the latest Cartopy? |
@QuLogic Ha, it looks well with the latest cartopy (0.20.1). Thanks a lot. @TomNicholas So, is it better to keep this open until the doc is updated? |
Thanks for the report. This is related to #4364 SciTools/cartopy#1638 and matplotlib/matplotlib#18317. |
Just to explain the issue a bit: The new default is That is usually fine, except the midpoint between 0 and 360 is 180, and we get a weird wrap. Cartopy (xarray) accounted for this with the old shading by adding a NaN. I've not followed what they are doing now. To get the old behaviour you simply need to do Sorry this is a pain, but the old behaviour of silently dropping data, while having a long lineage going back to Matlab, was deemed unacceptable. However, if this continues to be a nuisance to folks, I'm sure matplotlib would consider a new shading argument, something like |
@jklymak Thanks for the explanation.
Method1: Subset valueThis method works for the xarray tutorial data, but not for the TROPOMI polar-orbiting satellite data.
(The TROPOMI example data is uploaded to Google Drive) Method2: boundsThis issue still exists with bounds data:
|
I am closing this as fixed upstream. |
What happened:

The example of plotting data using pcolormesh has some spurious lines:
What you expected to happen:
No spurious lines.
Minimal Complete Verifiable Example:
Anything else we need to know?:
pcolormesh doc
Environment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.8.10 | packaged by conda-forge | (default, Sep 13 2021, 21:46:58)
[GCC 9.4.0]
python-bits: 64
OS: Linux
OS-release: 5.11.0-34-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 0.19.0
pandas: 1.3.3
numpy: 1.21.2
scipy: 1.7.1
netCDF4: 1.5.7
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.5.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2021.10.0
distributed: 2021.10.0
matplotlib: 3.4.3
cartopy: 0.19.0.post1
seaborn: None
numbagg: None
pint: None
setuptools: 58.0.4
pip: 21.2.4
conda: None
pytest: None
IPython: 7.28.0
sphinx: None
The text was updated successfully, but these errors were encountered: