# Assign labels to colorbar extensions (user or development issue)

I am not sure if this is a user issue or a development issue.
Using version 1.4.2
My code allows the user to hone in on a specific contour range, by changing
the minimum and maximum of the contour and the number of levels.
I am using colorbar "extend" to prevent any white patches, as the data may
have values outside the contour range.

I want the extensions to have tick values but I can't seem to figure out,
how to do it?

This is my code

import numpy as np
import matplotlib.pyplot as plt
xi = np.array([0., 0.5, 1.0])#xi data
yi = np.array([0., 0.5, 1.0])#yi data
zi = np.array([[0., 1.0, 2.0],[0., 1.0, 2.0],[-0.1, 1.0, 2.0]])#zi data
n=5#number of levels of user specified range
umin=0.5#user defined minimum of contour
umax=1#user defined maximum of contout
u = np.linspace(umin, umax, n)#user specified contour levels
cbtics = np.hstack([zi.min(),u,zi.max()])#contour ticks including maximum
and minimum of zi
plt.contourf(xi, yi, zi, u, cmap=plt.cm.jet,extend='both')#plot contour
cbar=plt.colorbar(extendrect='True',extendfrac='auto',spacing='proportional')#plot
colorbar
print cbar.ax.get_ylim()#show y limits
print cbar.ax.get_yticks()#show yticks
plt.show()

Using the user entered values:
ylim are (-0.25, 1.25)
but the yticks are:
[ 0. 0.2 0.4 0.6 0.8 1. ] range from 0 to 1

I'm guessing that the difference between ylim (-0.25 to 1.25) and yticks (0
to 1) is that I am using extensions, so is there no way to update y ticks to
include the extensions so that I can assign labels to the extensions?

ยทยทยท

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Assign-labels-to-colorbar-extensions-user-or-development-issue-tp44392.html
Sent from the matplotlib - users mailing list archive at Nabble.com.