Skip to content

Commit

Permalink
fix moments labels (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
aloctavodia authored Jun 17, 2024
1 parent ca01bf6 commit eac0928
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions preliz/internal/plot_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,10 @@ def get_moments(dist, moments):
}
str_m = []
seen = []
for moment in moments:
values = dist.moments(moments)
for moment, value in zip(moments, values):
if moment not in seen:
value = dist.moments(moment)
if isinstance(value, (np.ndarray, int, float)):
str_m.append(f"{names[moment]}={value:.3g}")
str_m.append(f"{names[moment]}={value:.3g}")

seen.append(moment)

Expand Down

0 comments on commit eac0928

Please sign in to comment.