If I understand your question fully, then yes it does.
Have a play, and let us know how you get on.

Best,

Phil

On 22 December 2014 at 11:15, Denis-Alexander Engemann <
denis.engem...@gmail.com> wrote:

> 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 <pelson....@gmail.com>:
>
>> 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 <
>> denis.engem...@gmail.com> 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
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to