Skip to content

Commit

Permalink
Fix Violin matplotlib rendering with non-finite values (#5135)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 16, 2021
1 parent 18b462d commit 2176344
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion holoviews/plotting/mpl/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def get_data(self, element, ranges, style):
label = ','.join([d.pprint_value(v) for d, v in zip(element.kdims, key)])
else:
label = key
data.append(group[group.vdims[0]])
d = group[group.vdims[0]]
data.append(d[np.isfinite(d)])
labels.append(label)
colors.append(elstyle[i].get('facecolors', 'blue'))
style['positions'] = list(range(len(data)))
Expand All @@ -213,6 +214,7 @@ def get_data(self, element, ranges, style):
element = element.aggregate(function=np.mean)
else:
element = element.clone([(element.aggregate(function=np.mean),)])

new_style = self._apply_transforms(element, ranges, style)
style = {k: v for k, v in new_style.items()
if k not in ['zorder', 'label']}
Expand Down

0 comments on commit 2176344

Please sign in to comment.