Matplotlib and masked arrays

Hi there,

is there a possibility to use imshow() with masked arrays? The
problem: I have a large matrix where no_data_values are denominated by
a certain number. It now would be very easy to mask these values and
let imshow for example display them in another color but not use them
in e.g. normalising the color scale.

I think I saw some other mechansm to do that in the cookbook but I'm
not sure if it can do what I want and at the moment the cookbook (or
rather the scipy server) seems to be down.

Best regards,
Hanno

···

--
Hanno Klemm
klemm@...948...

Hanno,

See examples/image_masked.py. I think it does what you want. If your version of mpl is recent enough to include this demo, then you are all set.

Eric

Hanno Klemm wrote:

···

Hi there,

is there a possibility to use imshow() with masked arrays? The
problem: I have a large matrix where no_data_values are denominated by
a certain number. It now would be very easy to mask these values and
let imshow for example display them in another color but not use them
in e.g. normalising the color scale.

I think I saw some other mechansm to do that in the cookbook but I'm
not sure if it can do what I want and at the moment the cookbook (or
rather the scipy server) seems to be down.

Best regards,
Hanno