code: def set_data(self, x, y):
      if len(x):
          self.text.set_position((x[-1], y[-1]))
  
      super().set_data(x, y)
  
file_path: matplotlib/galleries/examples/text_labels_and_annotations/line_with_text.py
imports: import matplotlib.pyplot
  import numpy
  import matplotlib.lines
  import matplotlib.text
  import matplotlib.transforms
label_desc: Use image node_id 5 for calling the MyLine obj's underlying member method code with example usage: obj.set_data(x, y) without return types