|
From: Eric F. <ef...@ha...> - 2009-05-25 21:09:07
|
marcusantonius wrote: > I should perhaps mention, that if i try > cbar=fig.colorbar(p1,orientation='horizontal',ticks=[0.0,2.0,4.0,6.0,8.0]) The ticks that it uses are taken from the list--they are the ones that are within the range of numbers mapped to colors. The list of ticks does not set that range. > cbar.ax.set_xticklabels(['0', '2', '4','6','8']) Setting ticklabels is dangerous unless you do it based on first getting the actual ticks and using their values, or if you are otherwise sure of their values. But it should be very rare that you have to do this. > the colorbar is drawn correctly, but I get the label 0 at position 2, the > label 2 at position 4 and 4 at pos. 6, the labels at the end are not > drawn... None of the labels correspond to their ticks in this case. Eric |