Hello,

I'm having trouble scaling the z-values for a filled contour plot. I would like to produce a series of plots like:

plot.contourf(x, y, z, 20, cmap=matplotlib.cm.RdBu_r)

but I would like there to be an absolute correspondence between a given z-value and a given color in the colormap no matter what the range of z-values for a particular plot. I thought the way to do this would be to use the norm keyword like:

normFunction = matplotlib.colors.normalize(vmin=minValue, maxValue)
plot.contourf(x, y, z, 20, norm=normFunction, cmap=matplotlib.cm.RdBu_r)

but this gives the error:

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/matplotlib/axes.py", line 4054, in contourf
    return ContourSet(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/matplotlib/contour.py", line 456, in __init__
    for level, level_upper, color in zip(lowers, uppers, self.tcolors):
AttributeError: ContourSet instance has no attribute 'tcolors'

Any suggestions?

Thanks,
Mike
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to