Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-04 Thread Ian Thomas
On 2 November 2014 16:30, Benjamin Root ben.r...@ou.edu wrote: Would it make sense to at least emit a warning when a mask is encountered. There are very few places in matplotlib where masked arrays are not allowed (I think histograms is the other spot, but I can't remember for sure). Ben,

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-02 Thread Ian Thomas
On 1 November 2014 18:20, Hartmut Kaiser hartmut.kai...@gmail.com wrote: Thanks Ian! Your detailed answer is much appreciated. As you might have already guessed, we have quite some problems creating clean geometries from the generated contour data. I have tried to put together one

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-02 Thread Benjamin Root
Would it make sense to at least emit a warning when a mask is encountered. There are very few places in matplotlib where masked arrays are not allowed (I think histograms is the other spot, but I can't remember for sure). On Sun, Nov 2, 2014 at 11:10 AM, Ian Thomas ianthoma...@gmail.com wrote:

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-02 Thread Hartmut Kaiser
Ian, You are using masked arrays where you shouldn't, again. The documentation for tricontour states that it expects z to be an array, it doesn't say masked array. If you pass it a masked array, it will ignore the mask. Hence you have a number of triangles that include a vertex with a

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-01 Thread Hartmut Kaiser
On 26 October 2014 00:18, Hartmut Kaiser hartmut.kai...@gmail.com wrote: At this point we assume, that polys[0] is a linear ring to be interpreted as a polygon exterior and polys[1:] are the corresponding interiors for polys[0]. Here are our questions: Is this assumption correct? Is

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-10-26 Thread Ian Thomas
On 26 October 2014 00:18, Hartmut Kaiser hartmut.kai...@gmail.com wrote: At this point we assume, that polys[0] is a linear ring to be interpreted as a polygon exterior and polys[1:] are the corresponding interiors for polys[0]. Here are our questions: Is this assumption correct? Is

[Matplotlib-users] Structure of contour object returned from tricontourf

2014-10-25 Thread Hartmut Kaiser
All, We try to generate contour polygons from an unstructured triangular grid stored in a netcdf file: import netCDF4 import matplotlib.tri as tri # read data var = netCDF4.Dataset('filename.cdf').variables x = var['x'][:] y = var['y'][:] elems = var['element'][:,:]-1 data =