class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","GraphicsObject","<","pyqtgraph.GraphicsObject",">","`"]
docstr: Check the shape of the data.
  Return a set of 2d array x, y, z ready to be used to draw the picture.
docstr_tok: ["Check","the","shape","of","the","data",".","Return","a","set","of","2d","array","x",",","y",",","z","ready","to","be","used","to","draw","the","picture","."]
code: def _prepareData(self, args):
      """
      Check the shape of the data.
      Return a set of 2d array x, y, z ready to be used to draw the picture.
      """
  
      # User didn't specified data
      if len(args) == 0:
          self.x = None
          self.y = None
          self.z = None
  
          self._dataBounds = None
  
      # User only specified z
      elif len(args) == 1:
          # If x and y is None, the polygons will be displaced on a grid
          x = np.arange(0, args[0].shape[0] + 1, 1)
          y = np.arange(0, args[0].shape[1] + 1, 1)
          self.x, self.y = np.meshgrid(x, y, indexing="ij")
          self.z = args[0]
  
          self._dataBounds = ((x[0], x[-1]), (y[0], y[-1]))
  
      # User specified x, y, z
      elif len(args) == 3:
          # Shape checking
          if (
              args[0].shape[0] != args[2].shape[0] + 1
              or args[0].shape[1] != args[2].shape[1] + 1
          ):
              raise ValueError(
                  "The dimension of x should be one greater than the one of z"
              )
  
          if (
              args[1].shape[0] != args[2].shape[0] + 1
              or args[1].shape[1] != args[2].shape[1] + 1
          ):
              raise ValueError(
                  "The dimension of y should be one greater than the one of z"
              )
  
          self.x = args[0]
          self.y = args[1]
          self.z = args[2]
  
          xmn, xmx = np.min(self.x), np.max(self.x)
          ymn, ymx = np.min(self.y), np.max(self.y)
          self._dataBounds = ((xmn, xmx), (ymn, ymx))
  
      else:
          raise ValueError("Data must been sent as (z) or (x, y, z)")
  
imports: import numpy
  from ..None import Qt, colormap
  from ..None import functions
  from ..Qt import QtCore, QtGui
  from .GraphicsObject import GraphicsObject
label_desc: Use image node_id 2 for calling the PColorMeshItem obj's underlying member method code with example usage: obj._prepareData(args) without return types