using .set_clip_path methods

Dear list,

I’m having a very simple use case where I want to clip an image using normalized xy coordinates.

Here 0, 0 would be the middle of the X and Y axes and the radius would be 0.5.

For some reason reason the following code does not achieve what I want:

https://gist.github.com/dengemann/9081fc259ee5d03ffc6a

Instead of masking the area outside of the circle everything is masked.

It seems as if the clipping workflow would not accept normalized positions but inches or pixels instead.

I’ve been looking for a unit parameter to set the coord system type or something similar but I haven’t been successful.

Any hint would be highly appreciated.

Best,

Denis

And to anticipate the question, I’m using a recent Anaconda for Mac OS X with matplotlib version 1.3.1.

···

On Tue, Jul 8, 2014 at 4:55 PM, Denis-Alexander Engemann <denis.engemann@…287…> wrote:

Dear list,

I’m having a very simple use case where I want to clip an image using normalized xy coordinates.

Here 0, 0 would be the middle of the X and Y axes and the radius would be 0.5.

For some reason reason the following code does not achieve what I want:

https://gist.github.com/dengemann/9081fc259ee5d03ffc6a

Instead of masking the area outside of the circle everything is masked.

It seems as if the clipping workflow would not accept normalized positions but inches or pixels instead.

I’ve been looking for a unit parameter to set the coord system type or something similar but I haven’t been successful.

Any hint would be highly appreciated.

Best,

Denis

… I meanwhile figured it out myself.

https://gist.github.com/dengemann/9081fc259ee5d03ffc6a

It wasn’t clear to me that one needs to pass the transform of the axis object.

Hope it will help someone else in the future.

Best,

Denis

···

On Tue, Jul 8, 2014 at 5:08 PM, Denis-Alexander Engemann <denis.engemann@…120…287…> wrote:

And to anticipate the question, I’m using a recent Anaconda for Mac OS X with matplotlib version 1.3.1.

On Tue, Jul 8, 2014 at 4:55 PM, Denis-Alexander Engemann <denis.engemann@…287…> wrote:

Dear list,

I’m having a very simple use case where I want to clip an image using normalized xy coordinates.

Here 0, 0 would be the middle of the X and Y axes and the radius would be 0.5.

For some reason reason the following code does not achieve what I want:

https://gist.github.com/dengemann/9081fc259ee5d03ffc6a

Instead of masking the area outside of the circle everything is masked.

It seems as if the clipping workflow would not accept normalized positions but inches or pixels instead.

I’ve been looking for a unit parameter to set the coord system type or something similar but I haven’t been successful.

Any hint would be highly appreciated.

Best,

Denis