pcolor

I have been trying to use pcolor() to display a grid with

    > discrete values (1-4) that are changing over time. I'm
    > generating a series of saved figures that also include a
    > line graph of the sums of the 4 categories. The problem
    > is that that mapping of numbers to colors isn't constant
    > for the pcolor output. I changed the array from Float32
    > (used out of habit) to integer and got the same type of
    > result. It would also be nice to be able to use the same
    > color mapping for both sub plots.

    > I think (guess) that cmap=cm.jet controls the color
    > scheme, but it isn't clear to me how to change that, what
    > format it has, or why it seems to change with repeated
    > calls to pcolor() inside the program.

It sounds to me like the color limits are being autoscaled with each
call to pcolor. cm.jet does define the color map, but the color
limits define the range of your data that correspond to the min and
max of the colormap.

See help(clim)

If after each call to pcolor, you manually set the clim, you should
have no problems.

JDH

···

-------------------------------------------------------

    > SF email is sponsored by - The IT Product Guide Read
    > honest & candid reviews on hundreds of IT Products from
    > real users. Discover which products truly live up to the
    > hype. Start reading now.
    > http://productguide.itmanagersjournal.com/
    > _______________________________________________
    > Matplotlib-users mailing list
    > Matplotlib-users@lists.sourceforge.net
    > https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks very much. Setting clim(0.0, 1.0) inside the loop stabilized the
color mapping.

Wendell Cropper

   > I have been trying to use pcolor() to display a grid with
   > discrete values (1-4) that are changing over time. I'm
   > generating a series of saved figures that also include a
   > line graph of the sums of the 4 categories. The problem
   > is that that mapping of numbers to colors isn't constant
   > for the pcolor output. I changed the array from Float32
   > (used out of habit) to integer and got the same type of
   > result. It would also be nice to be able to use the same
   > color mapping for both sub plots.

   > I think (guess) that cmap=cm.jet controls the color
   > scheme, but it isn't clear to me how to change that, what
   > format it has, or why it seems to change with repeated
   > calls to pcolor() inside the program.

It sounds to me like the color limits are being autoscaled with each
call to pcolor. cm.jet does define the color map, but the color
limits define the range of your data that correspond to the min and
max of the colormap.

See help(clim)

If after each call to pcolor, you manually set the clim, you should
have no problems.

JDH

   > -------------------------------------------------------
   > SF email is sponsored by - The IT Product Guide Read
   > honest & candid reviews on hundreds of IT Products from
   > real users. Discover which products truly live up to the
   > hype. Start reading now.
   > http://productguide.itmanagersjournal.com/
   > _______________________________________________
   > Matplotlib-users mailing list
   > Matplotlib-users@lists.sourceforge.net
   > https://lists.sourceforge.net/lists/listinfo/matplotlib-users

University of Florida
School of Forest Resources and Conservation
214 Newins-Ziegler
PO Box 110410
Gainesville, FL 32611-0410

352-846-0859 phone
352-392-1707 fax

wcropper@...416...

···

At 02:58 PM 11/30/2004 -0600, John Hunter wrote: