code: def apply_to_fig(self, fig_so_far):
      layout_updates = {}
      if self.title is not None:
          layout_updates["title"] = self.title
      if self.xlabel is not None:
          layout_updates["xaxis_title"] = self.xlabel
      if self.ylabel is not None:
          layout_updates["yaxis_title"] = self.ylabel
  
      fig_so_far.update_layout(**layout_updates)
  
      for legend_group, label in self.group_labels.items():
          fig_so_far.update_traces(
              {"legendgrouptitle_text": label},
              {"legendgroup": legend_group},
          )
  
file_path: hail/hail/python/hail/ggplot/labels.py
imports: from .geoms import FigureAttribute
label_desc: Use image node_id 2 for calling the Labels obj's underlying member method code with example usage: obj.apply_to_fig(fig_so_far) without return types