[Matplotlib-users] logarithmic axis on colorbar

Slavin, Jonathan jslavin at cfa.harvard.edu
Fri Sep 4 22:38:18 CEST 2015

Hi all,

I'm wanting to plot an image that is logarithmically scaled, and I'd like
to have the associated colorbar ticks be logarithmic.  So, for example, say
img is the image
fig,ax = plt.subplots()
cax = ax.imshow(np.log10(img))

gives me a colorbar with the tick labels with values that are the
log10(img) values, whereas I want the colorbar to be labeled with a
logarithmic axis and the img values.  How could I do that?  Any help would
be appreciated.


Jonathan D. Slavin                 Harvard-Smithsonian CfA
jslavin at cfa.harvard.edu       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20150904/f8b4c150/attachment.html>

More information about the Matplotlib-users mailing list