annotateplot

annotateplot(data: DataFrame, *, x: str, y: str, text: str, ax: Axes | None = None, adjusttext_kws: Mapping = frozendict.frozendict({}), **kwargs: dict) Axes[source]

Annotate a plot coordinates with text labels, then apply adjustText to rearrange the labels to avoid overlaps.

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.

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

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

  • adjusttext_kws (Mapping, default {}) – Additional keyword arguments forward to adjustText.

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

Returns:

The matplotlib Axes containing the plot.

Return type:

plt.Axes

Notes

This functionality is not provided by seaborn.