def _locate(self, x):
if isinstance(self.norm, (colors.NoNorm, colors.BoundaryNorm)):<EOL><INDENT>b = self._boundaries<EOL>xn = x<EOL>xout = x<EOL><DEDENT>else:<EOL><INDENT>b = self.norm(self._boundaries, clip=False).filled()<EOL>xn = self.norm(x, clip=False).filled()<EOL>in_cond = (xn > -<NUM_LIT>) & (xn < <NUM_LIT>)<EOL>xn = np.compress(in_cond, xn)<EOL>xout = np.compress(in_cond, x)<EOL><DEDENT>y = self._y<EOL>N = len(b)<EOL>ii = np.minimum(np.searchsorted(b, xn), N-<NUM_LIT:1>)<EOL>i0 = np.maximum(ii - <NUM_LIT:1>, <NUM_LIT:0>)<EOL>db = np.take(b, ii) - np.take(b, i0)<EOL>db = np.where(i0==ii, <NUM_LIT:1.0>, db)<EOL>dy = np.take(y, ii) - np.take(y, i0)<EOL>z = np.take(y, i0) + (xn-np.take(b,i0))*dy/db<EOL>return xout, z<EOL>
Given a possible set of color data values, return the ones
within range, together with their corresponding colorbar
data coordinates.