rekha.barΒΆ

rekha.bar(data=None, x=None, y=None, **kwargs)[source]ΒΆ

Create a bar plot with Rekha styling.

Parameters:
  • data (DataFrame, dict, or None) – The data to plot

  • x (str, list, array, or None) – Column names or data for x and y axes

  • y (str, list, array, or None) – Column names or data for x and y axes

  • color (str, optional) – Column name for color grouping

  • facet_row (str, optional) – Column name for creating subplot rows

  • facet_col (str, optional) – Column name for creating subplot columns

  • orientation (str, default 'v') – Bar orientation (β€˜v’ for vertical, β€˜h’ for horizontal)

  • text_auto (bool, default False) – Whether to automatically add value labels on bars

  • barmode (str, default 'group') – Bar mode (β€˜group’, β€˜stack’, β€˜relative’)

  • bar_edge (bool, default False) – Whether to add edges around bars

  • bar_edge_color (str, optional) – Color for bar edges (auto if None)

  • bar_edge_width (float, default 1.0) – Width of bar edges

  • bar_width (float, default 0.8) – Width of bars

  • title (str, optional) – Plot title

  • labels (dict, optional) – Dictionary mapping column names to display labels

  • dark_mode (bool, default False) – Whether to use dark theme

  • figsize (tuple, default (10, 6)) – Figure size (width, height)

  • grayscale_friendly (bool, default False) – Whether to add patterns for grayscale printing

  • **kwargs – Additional styling parameters

Returns:

Bar plot object with matplotlib figure and axes

Return type:

BarPlot

Examples

>>> import rekha as rk
>>> import pandas as pd
>>> df = pd.DataFrame({'x': ['A','B','C'], 'y': [1,3,2]})
>>> fig = rk.bar(df, x='x', y='y', title='My Bar Plot')
>>> fig.show()