Skip to content

Commit

Permalink
added annotation to histplot
Browse files Browse the repository at this point in the history
  • Loading branch information
john-james-ai committed Dec 24, 2023
1 parent 48e2851 commit 591369d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "studioai"
version = "0.2.13"
version = "0.2.14"
description = "Atelier for Artificial Intelligence and Data Science"
authors = [
"John James <[email protected]>",
Expand Down
8 changes: 7 additions & 1 deletion studioai/analysis/visualize/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# URL : https://github.com/john-james-ai/studioai #
# ------------------------------------------------------------------------------------------------ #
# Created : Saturday August 26th 2023 06:25:27 am #
# Modified : Sunday December 24th 2023 03:49:00 pm #
# Modified : Sunday December 24th 2023 04:31:56 pm #
# ------------------------------------------------------------------------------------------------ #
# License : MIT License #
# Copyright : (c) 2023 John James #
Expand Down Expand Up @@ -255,6 +255,7 @@ def histogram(
stat: str = "density",
element: str = "bars",
fill: bool = True,
annotate: bool = True,
title: str = None,
figsize: bool = (12, 4),
ax: plt.Axes = None,
Expand All @@ -275,6 +276,7 @@ def histogram(
that will be internally reshaped
x,y (str): Keys in data.
hue (str): Grouping variable that will produce lines with different colors. Can be either categorical or numeric, although color mapping will behave differently in latter case.
annotate (bool): Whether to annotate the plot with min, max, and mean values.
title (str): Title for the plot. Optional
figsize (tuple): Size of figure in inches. Ignored if ax is provided.
stat (str): Aggregate statistics for each bin. Optional. Default is 'density'.
Expand Down Expand Up @@ -304,6 +306,10 @@ def histogram(
*args,
**kwargs,
)

if annotate:
ax = self._annotate(ax=ax, data=data, x=x)

if title is not None:
_ = ax.set_title(title)

Expand Down
14 changes: 2 additions & 12 deletions tests/test_analysis/test_visual/test_visual.ipynb

Large diffs are not rendered by default.

0 comments on commit 591369d

Please sign in to comment.