Try

nm = matplotlib.colors.Normalize(desired_min, desired_max)

plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat"),norm=nm)

You could just use the vmin/vmax keywords in the scatter() call, but
I've just always preferred using Normalize(); you have more control
over what happens that way (see docs for Normalize).

ref: 
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter

On Mon, Oct 31, 2011 at 12:02 PM, Tommy Grav <tg...@mac.com> wrote:
> Hi,
>
>   I have been looking around but can't find what I want.
> I have two arrays, one with numbers from 0.02 to 0.20 and
> the other from 0.03 to 0.50. I am trying to plot them together
> with other arrays in a scatterplot where these two are the
> color term
>
> plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat))
> plt.scatter(x2,y2,c=myarr2,cmap=plt.get_cmap("gist_heat))
>
> but it seems that each instance of the plot command rescales
> the array such that myarr1.max() and myarr2.max() are both with,
> which means that the two color scales are out of sync. Is there
> a way to force the two plots to respect the values in the array
> have the cmap go from 0 to 1, not from myarr1.min() to myarr1.max()?
>
> Cheers
>  Tommy
>
> ------------------------------------------------------------------------------
> Get your Android app more play: Bring it to the BlackBerry PlayBook
> in minutes. BlackBerry App World&#153; now supports Android&#153; Apps
> for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple
> it is! http://p.sf.net/sfu/android-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



-- 
Daniel Hyams
dhy...@gmail.com

------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to