class_docstr: Layout of entire plot
class_docstr_tok: ["Layout","of","entire","plot"]
docstr: Return x & y scales for panel i
  
  Parameters
  ----------
  i : int
    Panel id
  
  Returns
  -------
  scales : types.SimpleNamespace
    Class attributes *x* for the x scale and *y*
    for the y scale of the panel
docstr_tok: ["Return","x","&","y","scales","for","panel","i","Parameters","--","--","--","--","--","i",":","int","Panel","id","Returns","--","--","--","-","scales",":","types.SimpleNamespace","Class","attributes","*","x","*","for","the","x","scale","and","*","y","*","for","the","y","scale","of","the","panel"]
code: def get_scales(self, i: int) -> pos_scales:
      """
      Return x & y scales for panel i
  
      Parameters
      ----------
      i : int
        Panel id
  
      Returns
      -------
      scales : types.SimpleNamespace
        Class attributes *x* for the x scale and *y*
        for the y scale of the panel
  
      """
      # wrapping with np.asarray prevents an exception
      # on some datasets
      bool_idx = np.asarray(self.layout["PANEL"]) == i
  
      idx = self.layout["SCALE_X"].loc[bool_idx].iloc[0]
      xsc = self.panel_scales_x[idx - 1]
  
      idx = self.layout["SCALE_Y"].loc[bool_idx].iloc[0]
      ysc = self.panel_scales_y[idx - 1]
  
      return pos_scales(x=xsc, y=ysc)
  
file_path: plotnine/plotnine/facets/layout.py
imports: from __future__ import annotations
  import typing
  from contextlib import suppress
  import numpy
  from .._utils import match
  from ..exceptions import PlotnineError
  from ..iapi import labels_view, layout_details, pos_scales
label_desc: Use image node_id 4 for calling the Layout obj's underlying member method code with example usage: obj.get_scales(i) and returns: pos_scales