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
griddata constant spacing check needs tweaking #666
Comments
In general, such an error can arise due to the use of linspace, instead of arange, as described here. However, in this particular case, the two methods produce identical results. The reason I'm not sure how to proceed is that the difference between dx.max() and dx.min() can be an order of magnitude greater than the epsx value it is compared against. Here's a modification to the original example that does this:
I believe that this has to do with the limited precision and non-uniformity of the possible numbers represented by the floating point standard. The check for constant spacing likely should take into account and compare dx.ptp() to the average dx itself, or something like that. |
@ivanov, I think you are exactly right. Perhaps you would generate a small PR to take care of this? |
I ran into the same problem today. I think the fix in my pull request should implement ivanov's proposed solution. |
With the current 1.4.x code based on |
as reported by Ethan Swint to the mpl-users mailing list:
I was working off of the example listed at
http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html,
adapting it to my own data, and encountered the following error on MLAB
1.1.0, Python 2.7.2:
which produces
The text was updated successfully, but these errors were encountered: