How adjust colors for color plots to different ranges?

The z-axis values that I want to denote with color on

    > this plot range from something like 57000 to 66000.

    > I think I somehow need to tell Matplotlib what these
    > minimum and maximum values are so that my color spectrum
    > can range over desired colors for my specific plotting
    > range.

    > How do this? (How make 57000 be one color extreme and
    > make 66000 be my other color extreme?)

What plotting function are you using, imshow, pcolor, scatter, etc?
The matplotlib color mapping and scaling will handle this
automatically. It assigns 57000 to the first color on your colormap
and 66000 to the last color, with interpolation between. There are a
variety of ways to customize this

  # vmin is 57000 but vmax is changed
  >>> imshow(X, vmax=70000)

  # vmin is 66000 but vmin is changed
  >>> imshow(X, vmin=50000)

  # vmin and vmax both customized
  >>> imshow(X, vmax=50000, vmax=70000)

Once you've plotted your data, you can use the clim function to set
the color limits

  >>> clim(55000, 60000)

Should help,
JDH

I'm using pcolor. All z values looked the same color. It may
be a my fault (my bug) if you say colors should be different.
I'll try your customizations too.

Does clim work with pcolor?

CS

···

On Mon, Dec 13, 2004 at 09:23:51AM -0600, John Hunter wrote:

    > The z-axis values that I want to denote with color on
    > this plot range from something like 57000 to 66000.

    > I think I somehow need to tell Matplotlib what these
    > minimum and maximum values are so that my color spectrum
    > can range over desired colors for my specific plotting
    > range.

    > How do this? (How make 57000 be one color extreme and
    > make 66000 be my other color extreme?)

What plotting function are you using, imshow, pcolor, scatter, etc?
The matplotlib color mapping and scaling will handle this
automatically. It assigns 57000 to the first color on your colormap
and 66000 to the last color, with interpolation between. There are a
variety of ways to customize this

  # vmin is 57000 but vmax is changed
  >>> imshow(X, vmax=70000)

  # vmin is 66000 but vmin is changed
  >>> imshow(X, vmin=50000)

  # vmin and vmax both customized
  >>> imshow(X, vmax=50000, vmax=70000)

Once you've plotted your data, you can use the clim function to set
the color limits

  >>> clim(55000, 60000)

Should help,
JDH

--
_______________________________________

Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
Code 2872
49258 Mills Street, Room 158
San Diego, CA 92152-5385
U.S.A.

Phone: (619) 553-9973
Fax : (619) 553-6521
Email: seberino@...391...
_______________________________________