If your limits are within a factor of ten of each other, matplotlib doesn't always quite know how to set the ticker appropriately. This recipe shows you one way to override it. The important bit here is the LogLocator addition, which says, label at 1 .. 10 times the base exponent. I used the numpy function mgrid for convenience, saying that I wanted 1 through 10 with 11 steps.
import matplotlib.ticker from yt.mods import * pf = load("DD0010/moving7_0010") pc = PlotCollection(pf) p = pc.add_projection("Density", 0, weight_field="Density") p.colorbar.locator = matplotlib.ticker.LogLocator(subs=na.mgrid[1:10:11j]) p.colorbar.formatter = matplotlib.ticker.LogFormatter(labelOnlyBase=False) pc.set_zlim(2e-25, 9e-25) pc.save("mod")
