I think that what you want can be achieved more simply than contouring. I've attached a quick example of how I would do this. I'm assuming that the data has the same form as pcolormesh, i.e, the z values are measured at grid centers but we have coordinate of the edges. This means that we can easily check if a given pixel is above or below the contour level and then we simply draw the appropriate gridlines. I'm not coalescing neighboring lines, but that's also possible.
If you're looking for something more complex than this simple in-or-out partitioning, this approach might still work but I'm not sure, in that case, that I understand what you're actually trying to do. -Eric p.s. two loops aren't necessary, really.
<<attachment: lattice_cntr_demo.png>>
lattice_cntr_demo.py
Description: lattice_cntr_demo.py
------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users