class_docstr: Base class for all positions
docstr: Transform all the variables that map onto the x and y scales.
  
  Parameters
  ----------
  data : dataframe
      Data to transform
  trans_x : callable
      Transforms x scale mappings
      Takes one argument, either a scalar or an array-type
  trans_y : callable
      Transforms y scale mappings
      Takes one argument, either a scalar or an array-type
docstr_tok: ["Transform","all","the","variables","that","map","onto","the","x","and","y","scales",".","Parameters","--","--","--","--","--","data",":","dataframe","Data","to","transform","trans_x",":","callable","Transforms","x","scale","mappings","Takes","one","argument",",","either","a","scalar","or","an","array-type","trans_y",":","callable","Transforms","y","scale","mappings","Takes","one","argument",",","either","a","scalar","or","an","array-type"]
code: def transform_position(
      data,
      trans_x: Optional[TransformCol] = None,
      trans_y: Optional[TransformCol] = None,
  ) -> pd.DataFrame:
      """
      Transform all the variables that map onto the x and y scales.
  
      Parameters
      ----------
      data : dataframe
          Data to transform
      trans_x : callable
          Transforms x scale mappings
          Takes one argument, either a scalar or an array-type
      trans_y : callable
          Transforms y scale mappings
          Takes one argument, either a scalar or an array-type
      """
      if len(data) == 0:
          return data
  
      if trans_x:
          xs = [name for name in data.columns if name in X_AESTHETICS]
          data[xs] = data[xs].apply(trans_x)
  
      if trans_y:
          ys = [name for name in data.columns if name in Y_AESTHETICS]
          data[ys] = data[ys].apply(trans_y)
  
      return data
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from copy import copy
  from warnings import warn
  import numpy
  from .._utils import check_required_aesthetics, groupby_apply
  from .._utils.registry import Register, Registry
  from ..exceptions import PlotnineError, PlotnineWarning
  from ..mapping.aes import X_AESTHETICS, Y_AESTHETICS
label_desc: Use image node_id 6 for calling the position obj's underlying member method code with example usage: obj.transform_position(data, trans_x, trans_y) and returns: data, data