Hi all,
I want to use imshow to plot an array of floats using
interpolation='nearest' so that every gridbox has a distinct color. Also I
want to limit the number of colors to a rather small number, e.g. 10. The
problem is that the tick labels are not at the edge of each color in the
colorbar, but somewhere in between.
An example is the trunk/matplotlib/examples/poormans_contour.py which does
not work in my case.
from pylab import *
delta = 0.01
x = arange(3.0, 3.0, delta)
y = arange(3.0, 3.0, delta)
X,Y = meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = Z2  Z1 # difference of Gaussians
cmap = cm.get_cmap('jet', 10) # 10 discrete colors
im = imshow(Z, cmap=cmap, interpolation='bilinear')
axis('off')
colorbar()
#savefig('test')
show()
Is there a solution?
Ciao Claas
