Skip to content

Commit

Permalink
sp
Browse files Browse the repository at this point in the history
  • Loading branch information
euxhenh committed Nov 13, 2023
1 parent fba47e6 commit 215e0c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/grinch/utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def plot1d(
"""Generates random variables from distribution `dist` and plots a
histogram in kde mode.
"""

# For better plot view in case there are a few extreme outliers
params = norm.fit(rvs)
z1 = norm.ppf(0.01, *params)
Expand All @@ -34,8 +35,10 @@ def plot1d(
rvs_to_plot = rvs

sns.violinplot(rvs_to_plot, color='#b56576')
ax = sns.stripplot(rvs_to_plot, color='black', size=1, jitter=1)
ax.set_title(title)
ax = sns.stripplot(rvs_to_plot, color='black', size=1, jitter=1, ax=ax)
assert ax is not None
if title is not None:
ax.set_title(title)
params = fit_nbinom(rvs) if dist == 'nbinom' else None
stats = stats1d(rvs, dist, params=params, pprint=True)
ax.axhline(stats['dist_q05'], color='#e56b6f', zorder=100)
Expand Down

0 comments on commit 215e0c0

Please sign in to comment.