On 2012/07/29 5:13 AM, Jeffrey Spencer wrote: > Eric, > > Normalize appears to be working correctly and as you stated above but > when passed into contourf appears to have inconsistent results not > following the docstring by allowing the value to change. > > Quick examples: > > X, Y = meshgrid(arange(20),arange(20)) > Z = arange(20*20) > Z = Z.reshape(20,20) > norm = colors.Normalize(vmin=200,vmax=None) > print norm.vmin > fig = figure(10) > ax = fig.add_subplot(111) > surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) > > This vmin has no effect where if you pass in: > > X, Y = meshgrid(arange(20),arange(20)) > Z = arange(20*20) > Z = Z.reshape(20,20) > norm = colors.Normalize(vmin=200,vmax=Z.max()) > print norm.vmin > fig = figure(10) > ax = fig.add_subplot(111) > surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) > > it has the desired effect. > > Let me know if this is correct or I'm missing something here. > > Cheers, > Jeff
You are correct. Contour and contourf are respecting vmin, vmax that have been set in the norm only if both have been set, so that it is fully scaled. I think that changing this to respect a single preset vmin or vmax would be reasonable. Eric ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users