MCPcopy Create free account
hub / github.com/holoviz/hvplot / barh

Method barh

hvplot/plotting/core.py:889–934  ·  view source on GitHub ↗

A horizontal bar plot A `barh` plot represents categorical data with rectangular bars with heights proportional to the values that they represent. The y-axis of the chart plots categories and the x-axis represents the value scale. The bars are of equal width

(self, x=None, y=None, stacked=False, **kwds)

Source from the content-addressed store, hash-verified

887 return self(x, y, kind='bar', stacked=stacked, **kwds)
888
889 def barh(self, x=None, y=None, stacked=False, **kwds):
890 """
891 A horizontal bar plot
892
893 A `barh` plot represents categorical data with rectangular bars
894 with heights proportional to the values that they represent. The y-axis of the chart
895 plots categories and the x-axis represents the value scale.
896 The bars are of equal width which allows for instant comparison of data.
897
898 `barh` can be used on dataframes with regular Index or MultiIndex.
899
900 Reference: https://hvplot.holoviz.org/ref/api/manual/hvplot.hvPlot.barh.html
901
902 Plotting options: https://hvplot.holoviz.org/ref/plotting_options/index.html
903
904 Parameters
905 ----------
906 stacked : bool, optional
907 If True, creates a stacked horizontal bar plot. Default is False.
908 **kwds : optional
909 Additional keywords arguments are documented in :ref:`plot-options`.
910 Run ``hvplot.help('barh')`` for the full method documentation.
911
912 Returns
913 -------
914 :class:`holoviews:holoviews.element.Bars` / Panel object
915 You can `print` the object to study its composition and run:
916
917 .. code-block::
918
919 import holoviews as hv
920 hv.help(the_holoviews_object)
921
922 to learn more about its parameters and options.
923
924 References
925 ----------
926
927 - Bokeh: https://docs.bokeh.org/en/latest/docs/reference/models/glyphs/hbar.html
928 - HoloViews: https://holoviews.org/reference/elements/bokeh/Bars.html
929 - Matplotlib: https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html
930 - Pandas: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.barh.html
931 - Plotly: https://plotly.com/python/horizontal-bar-charts/
932 - Wiki: https://en.wikipedia.org/wiki/Bar_chart
933 """
934 return self(x, y, kind='barh', stacked=stacked, **kwds)
935
936 def box(self, y=None, by=None, **kwds):
937 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected