class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
  
  :class:`PlotDataItem` provides a unified interface for displaying plot curves, scatter plots, or both.
  It also contains methods to transform or decimate the original data before it is displayed. 
  
  As pyqtgraph's standard plotting object, ``plot()`` methods such as :func:`pyqtgraph.plot` and
  :func:`PlotItem.plot() <pyqtgraph.PlotItem.plot>` create instances of :class:`PlotDataItem`.
  
  While it is possible to use :class:`PlotCurveItem <pyqtgraph.PlotCurveItem>` or
  :class:`ScatterPlotItem <pyqtgraph.ScatterPlotItem>` individually, this is recommended only
  where performance is critical and the limited functionality of these classes is sufficient.
  
  ==================================  ==============================================
  **Signals:**
  sigPlotChanged(self)                Emitted when the data in this item is updated.
  sigClicked(self, ev)                Emitted when the item is clicked.
  sigPointsClicked(self, points, ev)  Emitted when a plot point is clicked
                                      Sends the list of points under the mouse.
  sigPointsHovered(self, points, ev)  Emitted when a plot point is hovered over.
                                      Sends the list of points under the mouse.
  ==================================  ==============================================
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","GraphicsObject","<","pyqtgraph.GraphicsObject",">","`",":","class",":","`","PlotDataItem","`","provides","a","unified","interface","for","displaying","plot","curves",",","scatter","plots",",","or","both",".","It","also","contains","methods","to","transform","or","decimate","the","original","data","before","it","is","displayed",".","As","pyqtgraph","'s","standard","plotting","object",",","``","plot","(",")","``","methods","such","as",":","func",":","`","pyqtgraph.plot","`","and",":","func",":","`","PlotItem.plot","(",")","<","pyqtgraph.PlotItem.plot",">","`","create","instances","of",":","class",":","`","PlotDataItem","`",".","While","it","is","possible","to","use",":","class",":","`","PlotCurveItem","<","pyqtgraph.PlotCurveItem",">","`","or",":","class",":","`","ScatterPlotItem","<","pyqtgraph.ScatterPlotItem",">","`","individually",",","this","is","recommended","only","where","performance","is","critical","and","the","limited","functionality","of","these","classes","is","sufficient",".","==================================","==============================================","*","*","Signals",":","*","*","sigPlotChanged","(","self",")","Emitted","when","the","data","in","this","item","is","updated",".","sigClicked","(","self",",","ev",")","Emitted","when","the","item","is","clicked",".","sigPointsClicked","(","self",",","points",",","ev",")","Emitted","when","a","plot","point","is","clicked","Sends","the","list","of","points","under","the","mouse",".","sigPointsHovered","(","self",",","points",",","ev",")","Emitted","when","a","plot","point","is","hovered","over",".","Sends","the","list","of","points","under","the","mouse",".","==================================","=============================================="]
docstr: Clear any data displayed by this item and display new data.
  See :func:`__init__() <pyqtgraph.PlotDataItem.__init__>` for details; it accepts the same arguments.
docstr_tok: ["Clear","any","data","displayed","by","this","item","and","display","new","data",".","See",":","func",":","`","__init__","(",")","<","pyqtgraph.PlotDataItem.__init__",">","`","for","details",";","it","accepts","the","same","arguments","."]
code: def setData(self, *args, **kargs):
      """
      Clear any data displayed by this item and display new data.
      See :func:`__init__() <pyqtgraph.PlotDataItem.__init__>` for details; it accepts the same arguments.
      """
      # self.clear()
      if kargs.get("stepMode", None) is True:
          warnings.warn(
              'stepMode=True is deprecated and will result in an error after October 2022. Use stepMode="center" instead.',
              DeprecationWarning,
              stacklevel=3,
          )
      if "decimate" in kargs.keys():
          warnings.warn(
              "The decimate keyword has been deprecated. It has no effect and may result in an error in releases after October 2022. ",
              DeprecationWarning,
              stacklevel=2,
          )
  
      if "identical" in kargs.keys():
          warnings.warn(
              "The identical keyword has been deprecated. It has no effect may result in an error in releases after October 2022. ",
              DeprecationWarning,
              stacklevel=2,
          )
      profiler = debug.Profiler()
      y = None
      x = None
      if len(args) == 1:
          data = args[0]
          dt = dataType(data)
          if dt == "empty":
              pass
          elif dt == "listOfValues":
              y = np.array(data)
          elif dt == "Nx2array":
              x = data[:, 0]
              y = data[:, 1]
          elif dt == "recarray" or dt == "dictOfLists":
              if "x" in data:
                  x = np.array(data["x"])
              if "y" in data:
                  y = np.array(data["y"])
          elif dt == "listOfDicts":
              if "x" in data[0]:
                  x = np.array([d.get("x", None) for d in data])
              if "y" in data[0]:
                  y = np.array([d.get("y", None) for d in data])
              for k in [
                  "data",
                  "symbolSize",
                  "symbolPen",
                  "symbolBrush",
                  "symbolShape",
              ]:
                  if k in data:
                      kargs[k] = [d.get(k, None) for d in data]
          elif dt == "MetaArray":
              y = data.view(np.ndarray)
              x = data.xvals(0).view(np.ndarray)
          else:
              raise TypeError("Invalid data type %s" % type(data))
  
      elif len(args) == 2:
          seq = ("listOfValues", "MetaArray", "empty")
          dtyp = dataType(args[0]), dataType(args[1])
          if dtyp[0] not in seq or dtyp[1] not in seq:
              raise TypeError(
                  "When passing two unnamed arguments, both must be a list or array of values. (got %s, %s)"
                  % (str(type(args[0])), str(type(args[1])))
              )
          if not isinstance(args[0], np.ndarray):
              # x = np.array(args[0])
              if dtyp[0] == "MetaArray":
                  x = args[0].asarray()
              else:
                  x = np.array(args[0])
          else:
              x = args[0].view(np.ndarray)
          if not isinstance(args[1], np.ndarray):
              # y = np.array(args[1])
              if dtyp[1] == "MetaArray":
                  y = args[1].asarray()
              else:
                  y = np.array(args[1])
          else:
              y = args[1].view(np.ndarray)
  
      if "x" in kargs:
          x = kargs["x"]
          if dataType(x) == "MetaArray":
              x = x.asarray()
      if "y" in kargs:
          y = kargs["y"]
          if dataType(y) == "MetaArray":
              y = y.asarray()
  
      profiler("interpret data")
      ## pull in all style arguments.
      ## Use self.opts to fill in anything not present in kargs.
  
      if "name" in kargs:
          self.opts["name"] = kargs["name"]
          self.setProperty("styleWasChanged", True)
  
      if "connect" in kargs:
          self.opts["connect"] = kargs["connect"]
          self.setProperty("styleWasChanged", True)
  
      if "skipFiniteCheck" in kargs:
          self.opts["skipFiniteCheck"] = kargs["skipFiniteCheck"]
  
      ## if symbol pen/brush are given with no previously set symbol, then assume symbol is 'o'
      if "symbol" not in kargs and (
          "symbolPen" in kargs
          or "symbolBrush" in kargs
          or "symbolSize" in kargs
      ):
          if self.opts["symbol"] is None:
              kargs["symbol"] = "o"
  
      if "brush" in kargs:
          kargs["fillBrush"] = kargs["brush"]
  
      for k in list(self.opts.keys()):
          if k in kargs:
              self.opts[k] = kargs[k]
              self.setProperty("styleWasChanged", True)
      # curveArgs = {}
      # for k in ['pen', 'shadowPen', 'fillLevel', 'brush']:
      # if k in kargs:
      # self.opts[k] = kargs[k]
      # curveArgs[k] = self.opts[k]
  
      # scatterArgs = {}
      # for k,v in [('symbolPen','pen'), ('symbolBrush','brush'), ('symbol','symbol')]:
      # if k in kargs:
      # self.opts[k] = kargs[k]
      # scatterArgs[v] = self.opts[k]
  
      if y is None or len(y) == 0:  # empty data is represented as None
          yData = None
      else:  # actual data is represented by ndarray
          if not isinstance(y, np.ndarray):
              y = np.array(y)
          yData = y.view(np.ndarray)
          if x is None:
              x = np.arange(len(y))
  
      if x is None or len(x) == 0:  # empty data is represented as None
          xData = None
      else:  # actual data is represented by ndarray
          if not isinstance(x, np.ndarray):
              x = np.array(x)
          xData = x.view(
              np.ndarray
          )  # one last check to make sure there are no MetaArrays getting by
  
      if xData is None or yData is None:
          self._dataset = None
      else:
          self._dataset = PlotDataset(xData, yData)
      self._datasetMapped = None  # invalidata mapped data , will be generated in getData() / _getDisplayDataset()
      self._datasetDisplay = None  # invalidate display data, will be generated in getData() / _getDisplayDataset()
      self._adsLastValue = 1  # reset auto-downsample value
  
      profiler("set data")
  
      self.updateItems(styleUpdate=self.property("styleWasChanged"))
      self.setProperty(
          "styleWasChanged", False
      )  # items have been updated
      profiler("update items")
  
      self.informViewBoundsChanged()
  
      self.sigPlotChanged.emit(self)
      profiler("emit")
  
imports: import math
  import warnings
  import bisect
  import numpy
  from ..None import debug
  from ..None import functions
  from ..None import getConfigOption
  from ..Qt import QtCore
  from .GraphicsObject import GraphicsObject
  from .PlotCurveItem import PlotCurveItem
  from .ScatterPlotItem import ScatterPlotItem
label_desc: Use image node_id 28 for calling the PlotDataItem obj's underlying member method code with example usage: obj.setData() without return types