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
mpl.tri.Triangulation does not work but plt.tricontourf does #4424
Comments
According to the error message, your x-coordinates span the range 89.26 to 1e30, and your y-coordinates span the range 92.64 to 1e30. Hence your domain spans 28 orders of magnitude in both dimensions. This is likely to lead to precision errors! Why are you specifying a point at (1e30, 1e30)? |
I think the question is more of what is tricontourf() doing that On Wed, May 13, 2015 at 3:08 AM, Ian Thomas notifications@github.com
|
To answer the question about the 1e30 values... I'm taking data that represents a mesh with centers having values on a lat/lon grid. I first pass through my points to Baseman to convert them to projection space, and then construct the mesh on the projection. My understanding is that 1e30 is the default masked value for data outside of the projection? |
After looking around the tricontour and tricontourf code, in addition to the Basemap code that is working for generating the triangles, it looks like it masks the arrays before passing it to Triangulation. Perhaps this could be part of the problem? |
After further investigation, it appears that this is in fact not a bug with Triangulation, but my poor understanding of how to handle the Basemap projection conversion. I just copied and modified this block of code from the Basemap contourf function:
|
As described in the title, I can successfully plot data using tricontourf but cannot successfully do it by first creating triangles using tri.Triangulation.
The reason I would want to do this is because my data is on an unstructured grid that remains static, so it would be much more efficient if I could save the triangles to a file and load them any time I need to make a plot.
Here's the error I get from Triangulation using the verbose flag:
The text was updated successfully, but these errors were encountered: