rekha.scatterΒΆ

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

Create a scatter 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 or numerical coloring

  • size (str, list, array, or None) – Column name or data for point sizing

  • shape (str, optional) – Column name for shape/marker grouping

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

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

  • base_plot (BasePlot, optional) – Existing Rekha plot to add to. Enables composition of multiple plot types.

  • trendline (str, optional) – Type of trendline (β€˜ols’ for linear regression)

  • color_continuous_scale (str, optional) – Colormap for numerical color mapping

  • size_max (float, default 200) – Maximum point size for numerical sizing

  • point_size (float, default 100) – Base point size

  • alpha (float, default 0.7) – Point transparency

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

Scatter plot object with matplotlib figure and axes

Return type:

ScatterPlot

Examples

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