class_docstr: Grid of data.
class_docstr_tok: ["Grid","of","data","."]
code: def __init__(self, x, y):
      if np.ndim(x) == 1:
          pass
      elif np.ndim(x) == 2:
          x_row = x[0]
          if not np.allclose(x_row, x):
              raise ValueError("The rows of 'x' must be equal")
          x = x_row
      else:
          raise ValueError("'x' can have at maximum 2 dimensions")
  
      if np.ndim(y) == 1:
          pass
      elif np.ndim(y) == 2:
          yt = np.transpose(y)  # Also works for nested lists.
          y_col = yt[0]
          if not np.allclose(y_col, yt):
              raise ValueError("The columns of 'y' must be equal")
          y = y_col
      else:
          raise ValueError("'y' can have at maximum 2 dimensions")
  
      if not (np.diff(x) > 0).all():
          raise ValueError("'x' must be strictly increasing")
      if not (np.diff(y) > 0).all():
          raise ValueError("'y' must be strictly increasing")
  
      self.nx = len(x)
      self.ny = len(y)
  
      self.dx = x[1] - x[0]
      self.dy = y[1] - y[0]
  
      self.x_origin = x[0]
      self.y_origin = y[0]
  
      self.width = x[-1] - x[0]
      self.height = y[-1] - y[0]
  
      if not np.allclose(np.diff(x), self.width / (self.nx - 1)):
          raise ValueError("'x' values must be equally spaced")
      if not np.allclose(np.diff(y), self.height / (self.ny - 1)):
          raise ValueError("'y' values must be equally spaced")
  
imports: import numpy
  import matplotlib
  from matplotlib import _api, cm, patches
  import matplotlib.colors
  import matplotlib.collections
  import matplotlib.lines
label_desc: Use image node_id 1 to create a new Grid object  with example: obj = Grid(x, y)