Hi all,
I’ve encountered the following problem when trying to use a logarithmic color scale:
The code
import numpy as np
import matplotlib.pyplot as
plt
from matplotlib import ticker
x = np.arange(-100,105,5)
X,Y = np.meshgrid(x,x)
Z = X2 + Y2 + 0.1
plt.contourf(X,Y,Z.T, locator=ticker.LogLocator())
plt.colorbar()
works fine to create a contour map with logarithmic colorscale. Now I want to refine the scaling by adding more colorlevels. Therefore I add another option for the contourf() function, as follows:
plt.contourf(X,Y,Z.T, np.logspace(-1,5,15), locator=ticker.LogLocator())
However when I do this, all but one tick of the colorbar just
vanish. What is the reason for this and how can I fix that?
Kind regards,
Marko