You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New function signatures in pyplot break Cartopy #12288
It turns out that passing named arguments for everything broke Cartopy a bit because the first parameter of imshow there is img, not X.
It's also started explicitly passing data=None to all wrapped Axes methods that accept labelled data, which is slightly problematic since _preprocess_data is not public.
Sorry about that. It doesn't look too hard to make pyplot pass defaultless arguments positionally instead of as keywords if you'd like.
I guess you prefer not passing data through when it's None? (There's a plan to make _preprocess_data public too but that's a side point.) Although they were already passing it before (at least in some cases, didn't check carefully) so I'm not sure what changed?
We probably want to keep compatibility with old Cartopy, so we should change the positional arguments at least.
As to data, it was never explicit before, but caught by **kwargs. If never passed, it would not appear at all in the final call. Now it's there explicitly (even if None). I'm not sure if it should or should not be explicit in the signature, but it would be best if it's not passed when None at the very least.
Code for reproduction
importcartopy.crsasccrsimportmatplotlib.pyplotaspltimportnumpyasnp# First problemax=plt.axes(projection=crs.PlateCarree())
plt.imshow(np.zeros((100, 100)))
# Second problemplt.pcolormesh(np.zeros((100, 100)))
Activity
anntzer commentedon Oct 10, 2018
Closed by #12293, I think?