pcolor

I would like to use pcolor with the colors going from white (zero
values) to black (largest value).

I am using,

pcolor(a, shading = 'flat')
colorbar()

I do not see how to do this.

···

--
"The game of science can accurately be described as a never-ending
insult to human intelligence." - João Magueijo

Bryan Fodness wrote:

I would like to use pcolor with the colors going from white (zero
values) to black (largest value).

I am using,

pcolor(a, shading = 'flat')
colorbar()

I do not see how to do this.

pcolor(a, shading = 'flat', cmap=cm.binary)

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328

It may not be a binary map you want (that has just two colors) but a
reversed grayscale map which is continuous from white to black, in
which case you would use cmap=cm.gray_r

JDH

···

On Nov 19, 2007 10:08 PM, Jeff Whitaker <jswhit@...146...> wrote:

Bryan Fodness wrote:
> I would like to use pcolor with the colors going from white (zero
> values) to black (largest value).

pcolor(a, shading = 'flat', cmap=cm.binary)

John Hunter wrote:

···

On Nov 19, 2007 10:08 PM, Jeff Whitaker <jswhit@...146...> wrote:

Bryan Fodness wrote:

I would like to use pcolor with the colors going from white (zero
values) to black (largest value).

pcolor(a, shading = 'flat', cmap=cm.binary)

It may not be a binary map you want (that has just two colors) but a
reversed grayscale map which is continuous from white to black, in
which case you would use cmap=cm.gray_r

Agreed, logically it should be cm.gray_r. But, surprisingly, cm.binary looks identical. Maybe cm.binary is not doing what you intended it to do? (I have always found LinearSegmentedColormap hard to understand, in spite of what seems to be abundant explanation in the docstrings.)

Eric