I have image data 2d array with values that spans several
> decades. It would be extremely useful for me to be able
> to plot this data with imshow using a colorbar/color
> scale that is logarithmic. In the past I have just taken
> the log of the data, but that solution is not really
> acceptable for me. Any suggestions would be
> welcome. Perhaps someone could give me a idea on how to
> modify matplotlib to have this functionality. Thanks.
Jean-Luc also posted recently asking for logarithmic color scaling.
I would have thought that taking the log of your image data *would*
work for you. Can you explain why this doesn't -- I haven't worked
with logarithmic image data before so assume you are talking to a
Note you can provide your own custom normalization and colormap
instances to imshow. These are generic functionals, so you should e
able to do anything you want. There is an example of writing a custom
normalization and colormap instance here
If you write one that does what you need, please post it back here so
it can be folded into the mainline. If you have trouble with this, if
you just describe more thoroughly what you need one of us might be
able to do it.