class_docstr: A crosshair cursor like `~matplotlib.widgets.Cursor` with a text showing     the current coordinates.
  
  For the cursor to remain responsive you must keep a reference to it.
  The data of the axis specified as *dataaxis* must be in ascending
  order. Otherwise, the `numpy.searchsorted` call might fail and the text
  disappears. You can satisfy the requirement by sorting the data you plot.
  Usually the data is already sorted (if it was created e.g. using
  `numpy.linspace`), but e.g. scatter plots might cause this problem.
  The cursor sticks to the plotted line.
  
  Parameters
  ----------
  line : `matplotlib.lines.Line2D`
      The plot line from which the data coordinates are displayed.
  
  numberformat : `python format string <https://docs.python.org/3/    library/string.html#formatstrings>`_, optional, default: "{0:.4g};{1:.4g}"
      The displayed text is created by calling *format()* on this string
      with the two coordinates.
  
  offset : (float, float) default: (5, 5)
      The offset in display (pixel) coordinates of the text position
      relative to the cross-hair.
  
  dataaxis : {"x", "y"}, optional, default: "x"
      If "x" is specified, the vertical cursor line sticks to the mouse
      pointer. The horizontal cursor line sticks to *line*
      at that x value. The text shows the data coordinates of *line*
      at the pointed x value. If you specify "y", it works in the opposite
      manner. But: For the "y" value, where the mouse points to, there might
      be multiple matching x values, if the plotted function is not biunique.
      Cursor and text coordinate will always refer to only one x value.
      So if you use the parameter value "y", ensure that your function is
      biunique.
  
  Other Parameters
  ----------------
  textprops : `matplotlib.text` properties as dictionary
      Specifies the appearance of the rendered text object.
  
  **cursorargs : `matplotlib.widgets.Cursor` properties
      Arguments passed to the internal `~matplotlib.widgets.Cursor` instance.
      The `matplotlib.axes.Axes` argument is mandatory! The parameter
      *useblit* can be set to *True* in order to achieve faster rendering.
docstr: Overridden draw callback for cursor. Called when moving the mouse.
docstr_tok: ["Overridden","draw","callback","for","cursor",".","Called","when","moving","the","mouse","."]
code: def onmove(self, event):
      """
      Overridden draw callback for cursor. Called when moving the mouse.
      """
  
      # Leave method under the same conditions as in overridden method
      if self.ignore(event):
          self.lastdrawnplotpoint = None
          return
      if not self.canvas.widgetlock.available(self):
          self.lastdrawnplotpoint = None
          return
  
      # If the mouse left drawable area, we now make the text invisible.
      # Baseclass will redraw complete canvas after, which makes both text
      # and cursor disappear.
      if event.inaxes != self.ax:
          self.lastdrawnplotpoint = None
          self.text.set_visible(False)
          super().onmove(event)
          return
  
      # Get the coordinates, which should be displayed as text,
      # if the event coordinates are valid.
      plotpoint = None
      if event.xdata is not None and event.ydata is not None:
          # Get plot point related to current x position.
          # These coordinates are displayed in text.
          plotpoint = self.set_position(event.xdata, event.ydata)
          # Modify event, such that the cursor is displayed on the
          # plotted line, not at the mouse pointer,
          # if the returned plot point is valid
          if plotpoint is not None:
              event.xdata = plotpoint[0]
              event.ydata = plotpoint[1]
  
      # If the plotpoint is given, compare to last drawn plotpoint and
      # return if they are the same.
      # Skip even the call of the base class, because this would restore the
      # background, draw the cursor lines and would leave us the job to
      # re-draw the text.
      if plotpoint is not None and plotpoint == self.lastdrawnplotpoint:
          return
  
      # Baseclass redraws canvas and cursor. Due to blitting,
      # the added text is removed in this call, because the
      # background is redrawn.
      super().onmove(event)
  
      # Check if the display of text is still necessary.
      # If not, just return.
      # This behaviour is also cloned from the base class.
      if not self.get_active() or not self.visible:
          return
  
      # Draw the widget, if event coordinates are valid.
      if plotpoint is not None:
          # Update position and displayed text.
          # Position: Where the event occurred.
          # Text: Determined by set_position() method earlier
          # Position is transformed to pixel coordinates,
          # an offset is added there and this is transformed back.
          temp = [event.xdata, event.ydata]
          temp = self.ax.transData.transform(temp)
          temp = temp + self.offset
          temp = self.ax.transData.inverted().transform(temp)
          self.text.set_position(temp)
          self.text.set_text(self.numberformat.format(*plotpoint))
          self.text.set_visible(self.visible)
  
          # Tell base class, that we have drawn something.
          # Baseclass needs to know, that it needs to restore a clean
          # background, if the cursor leaves our figure context.
          self.needclear = True
  
          # Remember the recently drawn cursor position, so events for the
          # same position (mouse moves slightly between two plot points)
          # can be skipped
          self.lastdrawnplotpoint = plotpoint
      # otherwise, make text invisible
      else:
          self.text.set_visible(False)
  
      # Draw changes. Cannot use _update method of baseclass,
      # because it would first restore the background, which
      # is done already and is not necessary.
      if self.useblit:
          self.ax.draw_artist(self.text)
          self.canvas.blit(self.ax.bbox)
      else:
          # If blitting is deactivated, the overridden _update call made
          # by the base class immediately returned.
          # We still have to draw the changes.
          self.canvas.draw_idle()
  
file_path: matplotlib/galleries/examples/widgets/annotated_cursor.py
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.backend_bases import MouseEvent
  from matplotlib.widgets import Cursor
label_desc: Use image node_id 2 for calling the AnnotatedCursor obj's underlying member method code with example usage: obj.onmove(event) without return types