-
Notifications
You must be signed in to change notification settings - Fork 359
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
triplot IndexError when lost marker and linestyle paraments #1060
Comments
Hmm. This worked fine for me (without the extra arguments) on Python 3.6, matplotlib 2.2.2, cartopy 0.16.0, Shapely 1.6.4 (all from conda-forge). What about you? |
I upgraded matplotlib from 2.0.2 to 2.2.2 from https://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib, but it not works with Python 3.5, cartopy 0.16.0, Shapely 1.6.4. Also, I test this on another PC with Python 3.6.3, matplotlib 2.1.0, cartopy 0.16.0 & Shapely 1.6.4 (install by anaconda), the IndexError sitll happens. Thanks, @dopplershift |
Works for me too. I can't reproduce the issue with binaries from https://www.lfd.uci.edu/~gohlke/pythonlibs |
For me, this worked fine in Python Shell but failed in Jupyter notebook, so could you test it in Jupyter notebook? Thanks. @cgohlke @dopplershift |
Confirmed. I can reproduce the issue in Jupyter notebook. |
I can reproduce in the notebook as well. It looks like this is caused by the fact that the notebook calls
This at least makes it work for me. I need to dig further to understand why it fails. |
Ok, so the problem is that without a marker, ax.plot([], [], **kw) This yields a line with 0 points--just doing the above is enough to trigger the problem. The code for status = pj_transform(src_crs.proj4, self.proj4, npts, 3,
&result[0, 0], &result[0, 1], &result[0, 2]) (0 index on a size 0 axis is invalid). PR incoming... |
Empty arrays (i.e. one axis is size 0) were causing problems with transform_points since it was explicitly asking for index 0. Wrapping this in a check for the number of points seems to allow things to work just fine.
See #1062. |
Empty arrays (i.e. one axis is size 0) were causing problems with transform_points since it was explicitly asking for index 0. Wrapping this in a check for the number of points seems to allow things to work just fine.
Empty arrays (i.e. one axis is size 0) were causing problems with transform_points since it was explicitly asking for index 0. Wrapping this in a check for the number of points seems to allow things to work just fine.
Description
In my case, using
plt.triplot()
function when lostmarker
andlinestyle
paraments will cause an error.Code to reproduce
will case:
Traceback
but when I add 2 paraments
marker='o'
andlinestyle='-'
inplt.triplot()
function, it works:So, did I find a bug?
Full environment definition
Operating system
Windows 10, 1709, 64bit.
Cartopy version
CPython: 3.5.3
Cartopy: 0.16.0
pip list
The text was updated successfully, but these errors were encountered: