|
From: Ian T. <ian...@gm...> - 2011-01-27 20:52:11
|
Daniel, Following on from Eric's comments, attached is the simplest example I could come up with to do what you want. For non-filled contours, the 'segs' (last few lines of the file) should be fairly self-explanatory, and this is hopefully what you want. If you are after filled contours, you will need to understand both the 'segs' and the 'kinds' - essentially the segs comprise one or more discontinuous closed line loops and the corresponding kinds indicate how the loops are split up, a 1 being a LINETO and a 2 being a MOVETO. This can get a little awkward, and I think that sometimes you need to deal with arrays of arrays but I can't completely remember all the details. You should bear in mind that this code delves into matplotlib internals and you need to be careful as 1) it bypasses various sanity checks, 2) the underlying code could change at any point in the future (it has quite a lot in the last year for example). Otherwise, I hope it helps! Ian |