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 > z-value of -99999; when contoured these are going to give you lots of thin > polygons that you don't want. > You need to stop using masked arrays where they are not expected. Your > triangulation should only contain triangles for which you have valid data > at all three vertices. So either remove invalid triangles from your 'ele' > array before creating the triangulation, or set a mask on the > triangulation once it has been created, e.g. > > point_mask_indices = numpy.where(z.mask) > tri_mask = numpy.any(numpy.in1d(ele, point_mask_indices).reshape(-1, > 3), axis=1) > triang.set_mask(tri_mask)
Thanks very much for this explanation! With your code everything fell into place and we see the geometries we expect to see. Great library! Regards Hartmut --------------- http://boost-spirit.com http://stellar.cct.lsu.edu ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users