code: def _update_grid(self, x1, y1, x2, y2):
      if self._grid_info is None:
          self._grid_info = dict()
  
      grid_info = self._grid_info
  
      grid_finder = self.grid_finder
      extremes = grid_finder.extreme_finder(
          grid_finder.inv_transform_xy, x1, y1, x2, y2
      )
  
      lon_min, lon_max = sorted(extremes[:2])
      lat_min, lat_max = sorted(extremes[2:])
      grid_info["extremes"] = (
          lon_min,
          lon_max,
          lat_min,
          lat_max,
      )  # extremes
  
      lon_levs, lon_n, lon_factor = grid_finder.grid_locator1(
          lon_min, lon_max
      )
      lon_levs = np.asarray(lon_levs)
      lat_levs, lat_n, lat_factor = grid_finder.grid_locator2(
          lat_min, lat_max
      )
      lat_levs = np.asarray(lat_levs)
  
      grid_info["lon_info"] = lon_levs, lon_n, lon_factor
      grid_info["lat_info"] = lat_levs, lat_n, lat_factor
  
      grid_info["lon_labels"] = grid_finder.tick_formatter1(
          "bottom", lon_factor, lon_levs
      )
      grid_info["lat_labels"] = grid_finder.tick_formatter2(
          "bottom", lat_factor, lat_levs
      )
  
      lon_values = lon_levs[:lon_n] / lon_factor
      lat_values = lat_levs[:lat_n] / lat_factor
  
      lon_lines, lat_lines = grid_finder._get_raw_grid_lines(
          lon_values[(lon_min < lon_values) & (lon_values < lon_max)],
          lat_values[(lat_min < lat_values) & (lat_values < lat_max)],
          lon_min,
          lon_max,
          lat_min,
          lat_max,
      )
  
      grid_info["lon_lines"] = lon_lines
      grid_info["lat_lines"] = lat_lines
  
      lon_lines, lat_lines = grid_finder._get_raw_grid_lines(
          # lon_min, lon_max, lat_min, lat_max)
          extremes[:2],
          extremes[2:],
          *extremes,
      )
  
      grid_info["lon_lines0"] = lon_lines
      grid_info["lat_lines0"] = lat_lines
  
imports: import functools
  import numpy
  import matplotlib
  from matplotlib import _api, cbook
  import matplotlib.patches
  from matplotlib.path import Path
  from mpl_toolkits.axes_grid1.parasite_axes import host_axes_class_factory
  from .None import axislines, grid_helper_curvelinear
  from .axis_artist import AxisArtist
  from .grid_finder import ExtremeFinderSimple
label_desc: Use image node_id 4 for calling the GridHelperCurveLinear obj's underlying member method code with example usage: obj._update_grid(x1, y1, x2, y2) without return types