regplot

regplot(data: DataFrame, *, x: str, y: str, hue: str | None = None, hue_order: Any | None = None, ax: Axes | None = None, **kwargs: dict) Axes[source]

Plot regressions with seaborn’s regplot on a pandas DataFrame.

Parameters:
  • data (pd.DataFrame) – The DataFrame containing the data to plot.

  • x (str) – The name of the column in data to use for the x-axis values.

  • y (str) – The name of the column in data to use for the y-axis values.

  • hue (Optional[str], default None) – The name of the column in data to use for color encoding.

  • hue_order (Optional[Any], default None) – The order to plot the hue levels, if hue is not None.

  • ax (Optional[plt.Axes], default None) – The matplotlib Axes object to draw the plot onto, if provided.

  • **kwargs (dict) – Additional keyword arguments forward to seaborn’s regplot.

Returns:

The matplotlib Axes containing the plot.

Return type:

plt.Axes

Notes

This function extends seaborn’s regplot functionality by adding support for hue-based grouping and customizing plot aesthetics.