Simply set the colorbar locator to the LogLocator from matplotlib.ticker , and then call update_ticks() on the colorbar instance.
For example, consider this minimal example, which creates a color panel that you see with minor ticks:
import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.colors as colors import numpy as np fig, ax = plt.subplots(1)

If we now add the following two lines before calling plt.show() , we will remove the minor ticks:
cb.locator = ticker.LogLocator() cb.update_ticks()

Alternatively, to achieve the same, you can use ticks kwarg when creating a color panel and set it to LogLocator()
cb = fig.colorbar(p, ax=ax, ticks=ticker.LogLocator())
source share