code: def add_mpl_labels(heatmap_axes, rowlabels, collabels, params):
      
      if params.labels:
          # If a label mapping is missing, use the key text as fall back
          rowlabels = [params.labels.get(lab, lab) for lab in rowlabels]
          collabels = [params.labels.get(lab, lab) for lab in collabels]
      xlabs = heatmap_axes.set_xticklabels(collabels)
      ylabs = heatmap_axes.set_yticklabels(rowlabels)
      for label in xlabs:  # Rotate column labels
          label.set_rotation(90)
      for labset in (xlabs, ylabs):  # Smaller font
          for label in labset:
              label.set_fontsize(8)
docs: Add labels to Matplotlib heatmap axes, in-place.