Skip to content

Commit

Permalink
Fix pointplot dodge parameter
Browse files Browse the repository at this point in the history
Closes #43
  • Loading branch information
PierreGtch authored Oct 17, 2023
1 parent e293e87 commit 4cc0d81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ptitprince/PtitPrince.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,10 @@ def RainCloud(x = None, y = None, hue = None, data = None,
if pointplot:
n_plots = 4
if not hue is None:
n_cat = len(np.unique(data[hue]))
sns.pointplot(x = x, y = y, hue = hue, data = data,
orient = orient, order = order, hue_order = hue_order,
dodge = width_box/2., palette = palette, ax = ax, **kwpoint)
dodge = width_box * (1 - 1 / n_cat), palette = palette, ax = ax, **kwpoint)
else:
sns.pointplot(x = x, y = y, hue = hue, data = data, color = linecolor,
orient = orient, order = order, hue_order = hue_order,
Expand Down

0 comments on commit 4cc0d81

Please sign in to comment.