code: def scatter(self, x, y, **kwargs):
          
          variables = self.data['variable'].unique()
          xisvar = x in variables
          yisvar = y in variables
          if not xisvar and not yisvar:
              cols = [x, y] + self._discover_meta_cols(**kwargs)
              df = self.meta[cols].reset_index()
          elif xisvar and yisvar:
              # filter pivot both and rename
              dfx = (
                  self
                  .filter(variable=x)
                  .as_pandas(with_metadata=kwargs)
                  .rename(columns={'value': x, 'unit': 'xunit'})
                  .set_index(YEAR_IDX)
                  .drop('variable', axis=1)
              )
              dfy = (
                  self
                  .filter(variable=y)
                  .as_pandas(with_metadata=kwargs)
                  .rename(columns={'value': y, 'unit': 'yunit'})
                  .set_index(YEAR_IDX)
                  .drop('variable', axis=1)
              )
              df = dfx.join(dfy, lsuffix='_left', rsuffix='').reset_index()
          else:
              # filter, merge with meta, and rename value column to match var
              var = x if xisvar else y
              df = (
                  self
                  .filter(variable=var)
                  .as_pandas(with_metadata=kwargs)
                  .rename(columns={'value': var})
              )
          ax = plotting.scatter(df.dropna(), x, y, **kwargs)
          return ax
docs: Plot a scatter chart using metadata columns
  
          see pyam.plotting.scatter() for all available options