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 <
matthew.czesar...@gmail.com> 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
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to