rekha.boxΒΆ

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

Create a box plot with Rekha styling.

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

  • x (str, optional) – Column name for grouping variable

  • y (str, list, array, or None) – Column name or data for box plot values

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

  • facet_col (str, optional) – Column to use for creating subplots (facets)

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

  • 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:

Box plot object with matplotlib figure and axes

Return type:

BoxPlot

Examples

>>> import rekha as rk
>>> import pandas as pd
>>> import numpy as np
>>> df = pd.DataFrame({
...     'category': ['A', 'B', 'A', 'B', 'A', 'B'],
...     'values': [1, 2, 3, 4, 5, 6]
... })
>>> fig = rk.box(df, x='category', y='values', title='Box Plot')
>>> fig.show()