|
From: Benjamin R. <ben...@ou...> - 2014-08-28 13:32:28
|
That stuff is done in the deep underbelly of matplotlib and isn't exposed to the user. It is done as part of the rendering process in AGG or whichever other backend is performing the render. I have done something very similar to what you are asking for my job, and while I can't share the code, I can point out that GDAL has a very fast polygon rasterizer. I can also point you to this link: http://stackoverflow.com/questions/2220749/rasterizing-a-gdal-layer I will also say that there are some subtle errors in that code, but it should get you to where you need to go. Cheers! Ben Root On Thu, Aug 28, 2014 at 9:02 AM, Matthew Czesarski < mat...@gm...> wrote: > Hi Matplotlib Users! > > > > I have some 2-d arrays, which i am displaying with implot, and deriving > contours for with contour. Easy - I'm just pulling them out of > collections[0].get_paths() . > > However what's not easy is that I would like to recover a 1-0 or > True-False array of the array values (pixels) that fall within the > contours. Some line crossing algorithm/floodfill could do it, but I guess > that matplotlib's fill() or contourf() must do this under the hood anyway. > I've looked into the output both functions, but I don't see anything > obvious.. > > Does anybody know if there's an a way to pull out a such an array from > matplotlib? Any pointers are appreciated! > > Cheers, > Matt > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |