class_docstr: When there is a cycle, e.g., longitude goes from 0-360.
class_docstr_tok: ["When","there","is","a","cycle",",","e.g.",",","longitude","goes","from","0-360","."]
docstr: get extreme values.
  
  x1, y1, x2, y2 in image coordinates (0-based)
  nx, ny : number of divisions in each axis
docstr_tok: ["get","extreme","values",".","x1",",","y1",",","x2",",","y2","in","image","coordinates","(","0-based",")","nx",",","ny",":","number","of","divisions","in","each","axis"]
code: def __call__(self, transform_xy, x1, y1, x2, y2):
      """
      get extreme values.
  
      x1, y1, x2, y2 in image coordinates (0-based)
      nx, ny : number of divisions in each axis
      """
      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))
  
      # iron out jumps, but algorithm should be improved.
      # This is just naive way of doing and my fail for some cases.
      # Consider replacing this with numpy.unwrap
      # We are ignoring invalid warnings. They are triggered when
      # comparing arrays with NaNs using > We are already handling
      # that correctly using np.nanmin and np.nanmax
      with np.errstate(invalid="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
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import numpy
  import math
  from mpl_toolkits.axisartist.grid_finder import ExtremeFinderSimple
label_desc: Use image node_id 2 for calling the ExtremeFinderCycle obj's underlying member method code with example usage: obj.__call__(transform_xy, x1, y1, x2, y2) and returns: lon_min,  lon_max,  lat_min,  lat_max