'get extreme values.
x1, y1, x2, y2 in image coordinates (0-based)
nx, ny : number of divisions in each axis'

def __call__(self, transform_xy, x1, y1, x2, y2):

    (x_, y_) = (np.linspace(x1, x2, self.nx), np.linspace(y1, y2, self.ny))
    (x, y) = np.meshgrid(x_, y_)
    (lon, lat) = transform_xy(np.ravel(x), np.ravel(y))
    with np.errstate(invalid=u'ignore'):
        if (self.lon_cycle is not None):
            lon0 = np.nanmin(lon)
            lon -= (360.0 * ((lon - lon0) > 180.0))
        if (self.lat_cycle is not None):
            lat0 = np.nanmin(lat)
            lat -= (360.0 * ((lat - lat0) > 180.0))
    (lon_min, lon_max) = (np.nanmin(lon), np.nanmax(lon))
    (lat_min, lat_max) = (np.nanmin(lat), np.nanmax(lat))
    (lon_min, lon_max, lat_min, lat_max) = self._adjust_extremes(lon_min, lon_max, lat_min, lat_max)
    return (lon_min, lon_max, lat_min, lat_max)
