|
From: Eric F. <ef...@ha...> - 2012-07-31 23:20:04
|
On 2012/07/30 1:17 AM, Jeffrey Spencer wrote: > I'd agree as then it would work as pcolormesh or imshow does which when > passed in the same norm will only set vmin or vmax that wasn't > previously set. > > Assume this would be a really easy fix but I can have a look at > submitting a patch if someone else isn't going to do so just let me know. I will take care of it, thanks. Eric > > Cheers, > Jeff > > On Mon, Jul 30, 2012 at 2:31 AM, Eric Firing <ef...@ha... > <mailto:ef...@ha...>> wrote: > > 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 > > |