As far as I can tell, you cannot specify the color that contourf uses for masked values.
The examples enclosed with matplotlib ( 0.98.3) specifically comment that this is the case.
It appears that contourf just does not plot anything where the masked values occur and the background ( usually white ) is what is seen.
This is very useful but ....
I would like to have a bit more choice in how the areas of masked data are represented.
I came up with the following hack which seems to work, but being far from expert I wanted to know if anyone wished to help or give advice.
Is this reasonable or what ?
In the code below data is a masked array with some areas masked.
The result is that the missing areas are now black rather than white ( the default background, I guess)
fig = pylab.figure()
ax = fig.add_subplot(111)
cs = ax.contourf(data)
I am aware that pcolor , pcolormesh and using cm.set_bad will work but I also wanted the option for contourf - it produces nice looking plots.
Thanks for any help.