imshow restricted to circle

Hi, I have a question about the command “imshow”. Is there a way to have such a colorplot only limited to a circular area?

I want to have it look like the colorplots in

http://www.uke.uni-hamburg.de/kliniken/neurologie/downloads/klinik-neurologie/Hummel_Figure7.jpg

Nice is also something like
http://www.sol.lu.se/humlab/research/img/erp02.jpg

Can it be done with matplotlib?

So you might have noticed that I’m in neuroscience. Do you know any helpful packages for this field?

Greets,
Thorsten

Not quite. I recently added support for clipping to polygons in *Agg,
but I haven't ported this to all the mpl Artists yet. In particular,
I haven't done it for images. You might be able to do it yourself if
you wanted to explicitly set the alpha channel, so that alpha outside
the circle was 0.

JDH

···

On 5/16/07, Thorsten Kranz <thorstenkranz@...982...> wrote:

Hi, I have a question about the command "imshow". Is there a way to have
such a colorplot only limited to a circular area?

I want to have it look like the colorplots in

http://www.uke.uni-hamburg.de/kliniken/neurologie/downloads/klinik-neurologie/Hummel_Figure7.jpg

Nice is also something like
http://www.sol.lu.se/humlab/research/img/erp02.jpg

Can it be done with matplotlib?

Hi,

Hi, I have a question about the command "imshow". Is there a way to have
such a colorplot only limited to a circular area?

I want to have it look like the colorplots in

http://www.uke.uni-hamburg.de/kliniken/neurologie/downloads/klinik-neurologie/Hummel_Figure7.jpg

I have used the same sort of plots for the polar regions, where you
sometimes want to concentrate on one single annulus. One thing you can
do is to have a mask, with the same size as your matrix. You calcualte
r_ij = sqrt(xi*xi + yj*yj), set a threshold U and let the mask be
equal to 1 if r<=U, or else 0. When you apply the mask, the area
outside your radius of interest will be masked out.

I know, I know... long winded :slight_smile:

Cheers,
Jose

···

On 5/16/07, Thorsten Kranz <thorstenkranz@...982...> wrote:

Thanks a lot anyway! So I will have a look a Custom solution…