From: Eric F. <ef...@ha...> - 2009-09-30 19:52:41
|
Dr. Phillip M. Feldman wrote: > I'd like to generate a scatter plot in which symbols are colored using a > specified colormap, with a specified mapping from the range of the data to > the [0,1] colormap interval. I thought at first that one could use the norm > argument to specify a function that would perform this mapping, but from > closer reading of the documentation (and experimentation) it seems as though > one cannot do this. Is there another mechanism for doing this? (I could > remap the data itself before plotting it, but this is unacceptable because > the colorbar tic lables would then take values in [0,1] rather than values > from the range of the data). > I don't understand--what you say you want to do is exactly what the norm is designed for. Maybe the problem is that you can't pass in a simple function--you need to subclass colors.Normalize. An example is colors.LogNorm. It looks like what we need is a FuncNorm, which would be initialized with two functions, the forward and inverse transformation functions, each taking vmin, vmax, and a val. Eric |