From: Denis-Alexander E. <den...@gm...> - 2014-12-22 11:16:15
|
Thanks Phil, just to make sure I inderstand the logic of PathPatch. Does it cut out vertices / paths that are detected to be inside an outline as the star in this example? -Denis 2014-12-22 12:09 GMT+01:00 Phil Elson <pel...@gm...>: > Sorry its taken so long to get an answer, but essentially you want to > concatenate the outer coordinates with the inner ones (reversed) to > indicate that it is a hole. There is a pretty (simple) useful example that > I added a few years ago for demonstrating the use of paths for markers: > http://matplotlib.org/examples/pylab_examples/marker_path.html > > Constructing a patch from a path is as simple as (untested): > > import matplotlib.patches as mpatches > patch = mpatches.PathPatch(my_path, facecolor='red', edgecolor='yellow') > axes.add_patch(patch) > > > HTH, > > Phil > > > On 19 December 2014 at 23:01, Denis-Alexander Engemann < > den...@gm...> wrote: > >> Dear list, >> >> I would like to create a custom image clipping mask using patches. My >> constraint is that my patch is required to have an outer and multiple inner >> outlines. >> To provide an analogy, think of a mask used for disguise where you leave >> three holes, two for the eyes, one for the mouth. >> I have the xy coordinates for the 'head', and the xy coordinates for each >> of the holes that I don't want to be hidden by the ensuing clipping mask. >> >> What's the matplotlib way to construct my desired path + patch from that? >> Note, it's important in my case to use a patch object. What I need to do >> would not work by simply masking my image using a masked array. >> >> Any pointer would be highly appreciated -- >> Denis >> >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> >> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |