class_docstr: Series/Frames plotting accessor and method.
  
  Uses the backend specified by the
  option ``plotting.backend``. By default, plotly is used.
  
  Plotting methods can also be accessed by calling the accessor as a method
  with the ``kind`` argument:
  ``s.plot(kind='hist')`` is equivalent to ``s.plot.hist()``
docstr: Make a horizontal bar plot.
  
  A horizontal bar plot is a plot that presents quantitative data with
  rectangular bars with lengths proportional to the values that they
  represent. A bar plot shows comparisons among discrete categories. One
  axis of the plot shows the specific categories being compared, and the
  other axis represents a measured value.
  
  Parameters
  ----------
  x : label or position, default DataFrame.index
      Column to be used for categories.
  y : label or position, default All numeric columns in dataframe
      Columns to be plotted from the DataFrame.
  **kwds
      Keyword arguments to pass on to
      :meth:`pyspark.pandas.DataFrame.plot` or :meth:`pyspark.pandas.Series.plot`.
  
  Returns
  -------
  :class:`plotly.graph_objs.Figure`
      Return an custom object when ``backend!=plotly``.
      Return an ndarray when ``subplots=True`` (matplotlib-only).
  
  See Also
  --------
  plotly.express.bar : Plot a vertical bar plot using plotly.
  matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib.
  
  Examples
  --------
  For Series:
  
  .. plotly::
  
      >>> df = ps.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20]})
      >>> df.val.plot.barh()  # doctest: +SKIP
  
  For DataFrame:
  
  .. plotly::
  
      >>> df = ps.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20]})
      >>> df.plot.barh(x='lab', y='val')  # doctest: +SKIP
  
  Plot a whole DataFrame to a horizontal bar plot
  
  .. plotly::
  
      >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
      >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
      >>> index = ['snail', 'pig', 'elephant',
      ...          'rabbit', 'giraffe', 'coyote', 'horse']
      >>> df = ps.DataFrame({'speed': speed,
      ...                    'lifespan': lifespan}, index=index)
      >>> df.plot.barh()  # doctest: +SKIP
  
  Plot a column of the DataFrame to a horizontal bar plot
  
  .. plotly::
  
      >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
      >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
      >>> index = ['snail', 'pig', 'elephant',
      ...          'rabbit', 'giraffe', 'coyote', 'horse']
      >>> df = ps.DataFrame({'speed': speed,
      ...                    'lifespan': lifespan}, index=index)
      >>> df.plot.barh(y='speed')  # doctest: +SKIP
  
  Plot DataFrame versus the desired column
  
  .. plotly::
  
      >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
      >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
      >>> index = ['snail', 'pig', 'elephant',
      ...          'rabbit', 'giraffe', 'coyote', 'horse']
      >>> df = ps.DataFrame({'speed': speed,
      ...                    'lifespan': lifespan}, index=index)
      >>> df.plot.barh(x='lifespan')  # doctest: +SKIP
docstr_tok: ["Make","a","horizontal","bar","plot",".","A","horizontal","bar","plot","is","a","plot","that","presents","quantitative","data","with","rectangular","bars","with","lengths","proportional","to","the","values","that","they","represent",".","A","bar","plot","shows","comparisons","among","discrete","categories",".","One","axis","of","the","plot","shows","the","specific","categories","being","compared",",","and","the","other","axis","represents","a","measured","value",".","Parameters","--","--","--","--","--","x",":","label","or","position",",","default","DataFrame.index","Column","to","be","used","for","categories",".","y",":","label","or","position",",","default","All","numeric","columns","in","dataframe","Columns","to","be","plotted","from","the","DataFrame",".","*","*","kwds","Keyword","arguments","to","pass","on","to",":","meth",":","`","pyspark.pandas.DataFrame.plot","`","or",":","meth",":","`","pyspark.pandas.Series.plot","`",".","Returns","--","--","--","-",":","class",":","`","plotly.graph_objs.Figure","`","Return","an","custom","object","when","``","backend","!","=plotly","``",".","Return","an","ndarray","when","``","subplots=True","``","(","matplotlib-only",")",".","See","Also","--","--","--","--","plotly.express.bar",":","Plot","a","vertical","bar","plot","using","plotly",".","matplotlib.axes.Axes.bar",":","Plot","a","vertical","bar","plot","using","matplotlib",".","Examples","--","--","--","--","For","Series",":","..","plotly",":",":",">",">",">","df","=","ps.DataFrame","(","{","'lab","'",":","[","'","A","'",",","'","B","'",",","'","C","'","]",",","'val","'",":","[","10",",","30",",","20","]","}",")",">",">",">","df.val.plot.barh","(",")","#","doctest",":","+SKIP","For","DataFrame",":","..","plotly",":",":",">",">",">","df","=","ps.DataFrame","(","{","'lab","'",":","[","'","A","'",",","'","B","'",",","'","C","'","]",",","'val","'",":","[","10",",","30",",","20","]","}",")",">",">",">","df.plot.barh","(","x='lab","'",",","y='val","'",")","#","doctest",":","+SKIP","Plot","a","whole","DataFrame","to","a","horizontal","bar","plot","..","plotly",":",":",">",">",">","speed","=","[","0.1",",","17.5",",","40",",","48",",","52",",","69",",","88","]",">",">",">","lifespan","=","[","2",",","8",",","70",",","1.5",",","25",",","12",",","28","]",">",">",">","index","=","[","'snail","'",",","'pig","'",",","'elephant","'",",","...","'rabbit","'",",","'giraffe","'",",","'coyote","'",",","'horse","'","]",">",">",">","df","=","ps.DataFrame","(","{","'speed","'",":","speed",",","...","'lifespan","'",":","lifespan","}",",","index=index",")",">",">",">","df.plot.barh","(",")","#","doctest",":","+SKIP","Plot","a","column","of","the","DataFrame","to","a","horizontal","bar","plot","..","plotly",":",":",">",">",">","speed","=","[","0.1",",","17.5",",","40",",","48",",","52",",","69",",","88","]",">",">",">","lifespan","=","[","2",",","8",",","70",",","1.5",",","25",",","12",",","28","]",">",">",">","index","=","[","'snail","'",",","'pig","'",",","'elephant","'",",","...","'rabbit","'",",","'giraffe","'",",","'coyote","'",",","'horse","'","]",">",">",">","df","=","ps.DataFrame","(","{","'speed","'",":","speed",",","...","'lifespan","'",":","lifespan","}",",","index=index",")",">",">",">","df.plot.barh","(","y='speed","'",")","#","doctest",":","+SKIP","Plot","DataFrame","versus","the","desired","column","..","plotly",":",":",">",">",">","speed","=","[","0.1",",","17.5",",","40",",","48",",","52",",","69",",","88","]",">",">",">","lifespan","=","[","2",",","8",",","70",",","1.5",",","25",",","12",",","28","]",">",">",">","index","=","[","'snail","'",",","'pig","'",",","'elephant","'",",","...","'rabbit","'",",","'giraffe","'",",","'coyote","'",",","'horse","'","]",">",">",">","df","=","ps.DataFrame","(","{","'speed","'",":","speed",",","...","'lifespan","'",":","lifespan","}",",","index=index",")",">",">",">","df.plot.barh","(","x='lifespan","'",")","#","doctest",":","+SKIP"]
code: def barh(self, x=None, y=None, **kwargs):
      """
      Make a horizontal bar plot.
  
      A horizontal bar plot is a plot that presents quantitative data with
      rectangular bars with lengths proportional to the values that they
      represent. A bar plot shows comparisons among discrete categories. One
      axis of the plot shows the specific categories being compared, and the
      other axis represents a measured value.
  
      Parameters
      ----------
      x : label or position, default DataFrame.index
          Column to be used for categories.
      y : label or position, default All numeric columns in dataframe
          Columns to be plotted from the DataFrame.
      **kwds
          Keyword arguments to pass on to
          :meth:`pyspark.pandas.DataFrame.plot` or :meth:`pyspark.pandas.Series.plot`.
  
      Returns
      -------
      :class:`plotly.graph_objs.Figure`
          Return an custom object when ``backend!=plotly``.
          Return an ndarray when ``subplots=True`` (matplotlib-only).
  
      See Also
      --------
      plotly.express.bar : Plot a vertical bar plot using plotly.
      matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib.
  
      Examples
      --------
      For Series:
  
      .. plotly::
  
          >>> df = ps.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20]})
          >>> df.val.plot.barh()  # doctest: +SKIP
  
      For DataFrame:
  
      .. plotly::
  
          >>> df = ps.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20]})
          >>> df.plot.barh(x='lab', y='val')  # doctest: +SKIP
  
      Plot a whole DataFrame to a horizontal bar plot
  
      .. plotly::
  
          >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
          >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
          >>> index = ['snail', 'pig', 'elephant',
          ...          'rabbit', 'giraffe', 'coyote', 'horse']
          >>> df = ps.DataFrame({'speed': speed,
          ...                    'lifespan': lifespan}, index=index)
          >>> df.plot.barh()  # doctest: +SKIP
  
      Plot a column of the DataFrame to a horizontal bar plot
  
      .. plotly::
  
          >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
          >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
          >>> index = ['snail', 'pig', 'elephant',
          ...          'rabbit', 'giraffe', 'coyote', 'horse']
          >>> df = ps.DataFrame({'speed': speed,
          ...                    'lifespan': lifespan}, index=index)
          >>> df.plot.barh(y='speed')  # doctest: +SKIP
  
      Plot DataFrame versus the desired column
  
      .. plotly::
  
          >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
          >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
          >>> index = ['snail', 'pig', 'elephant',
          ...          'rabbit', 'giraffe', 'coyote', 'horse']
          >>> df = ps.DataFrame({'speed': speed,
          ...                    'lifespan': lifespan}, index=index)
          >>> df.plot.barh(x='lifespan')  # doctest: +SKIP
      """
      from pyspark.pandas import DataFrame, Series
  
      if isinstance(self.data, Series):
          return self(kind="barh", **kwargs)
      elif isinstance(self.data, DataFrame):
          return self(kind="barh", x=x, y=y, **kwargs)
  
imports: import importlib
  import pandas
  import numpy
  from pandas.core.base import PandasObject
  from pandas.core.dtypes.inference import is_integer
  from pyspark.ml.feature import Bucketizer
  from pyspark.mllib.stat import KernelDensity
  from pyspark.sql import functions
  from pyspark.pandas.missing import unsupported_function
  from pyspark.pandas.config import get_option
  from pyspark.pandas.utils import name_like_string
label_desc: Use image node_id 7 for calling the PandasOnSparkPlotAccessor obj's underlying member method code with example usage: obj.barh(x, y) and returns: self, self