[Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
I want to generate a 2-d figure with a (fixed) color scale that does not vary with the range of the data being plotted. How do I do this? Attempts to specify vimin and vmax appear to be ignored. The following example: #code import numpy data = numpy.zeros(shape=(240,240),dtype=int) data[

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jae-Joon Lee
On Thu, Jun 3, 2010 at 4:00 PM, Jim Vickroy jim.vick...@noaa.gov wrote: How do I do this?  Attempts to specify vimin and vmax appear to be ignored. Hmm, vmin and vmax should work. cax= ax.imshow(data, interpolation='bilinear', vmin=-1, vmax=1) If these are still ignored, what the

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
Jae-Joon Lee wrote: On Thu, Jun 3, 2010 at 4:00 PM, Jim Vickroy jim.vick...@noaa.gov wrote: How do I do this? Attempts to specify vimin and vmax appear to be ignored. Hmm, vmin and vmax should work. cax= ax.imshow(data, interpolation='bilinear', vmin=-1, vmax=1) If these are

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Eric Firing
On 06/03/2010 10:00 AM, Jim Vickroy wrote: I want to generate a 2-d figure with a (fixed) color scale that does not vary with the range of the data being plotted. How do I do this? Attempts to specify vimin and vmax appear to be ignored. The following example: #code import numpy data =

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
Eric Firing wrote: On 06/03/2010 10:00 AM, Jim Vickroy wrote: I want to generate a 2-d figure with a (fixed) color scale that does not vary with the range of the data being plotted. How do I do this? Attempts to specify vimin and vmax appear to be ignored. The following example: #code

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
OK, upon a more careful review of the code, I made a simple(-minded) error. Specifying vmin and vmax do work (as everyone already knew). Thanks to Jae-Joon and Eric for their quick replies. and valuable suggestions. -- jv Jim Vickroy wrote: I want to generate a 2-d figure with a (fixed)