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:
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()