code: def add_defaults(self, data, aesthetics):
          
          if not aesthetics:
              return
  
          # aesthetics with scales
          aws = set()
          if self:
              for s in (set(sc.aesthetics) for sc in self):
                  aws.update(s)
  
          # aesthetics that do not have scales present
          # We preserve the order of the aesthetics
          new_aesthetics = [x for x in aesthetics.keys() if x not in aws]
          if not new_aesthetics:
              return
  
          # If a new aesthetic corresponds to a column in the data
          # frame, find a default scale for the type of data in that
          # column
          seen = set()
          for ae in new_aesthetics:
              col = aesthetics[ae]
              if col not in data:
                  col = ae
              scale_var = aes_to_scale(ae)
  
              if self.get_scales(scale_var):
                  continue
  
              seen.add(scale_var)
              try:
                  sc = make_scale(scale_var, data[col])
              except PlotnineError:
                  # Skip aesthetics with no scales (e.g. group, order, etc)
                  continue
              self.append(sc)
docs: Add default scales for the aesthetics if none are
          present
  
          Scales are added only if the aesthetic is mapped to
          a column in the dataframe. This function may have to be
          called separately after evaluating the aesthetics.