Skip to content

Commit 3ec6e31

Browse files
committed
fixed color_palette specification in cdd
1 parent 9693af8 commit 3ec6e31

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scikit_posthocs/_plotting.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def critical_difference_diagram(
438438
that indicate lack of statistically significant difference. By default
439439
None.
440440
441-
color_palette: dict, optional
441+
color_palette: dict or list, optional
442442
Parameters to be passed when you need specific colors for each category
443443
444444
text_h_margin : float, optional
@@ -604,7 +604,9 @@ def plot_items(points, xpos, label_fmt, color_palette, label_props):
604604
points_right[::-1],
605605
xpos=points_right.iloc[-1] + text_h_margin,
606606
label_fmt=label_fmt_right,
607-
color_palette=list(reversed(color_palette)),
607+
color_palette=list(reversed(color_palette))
608+
if isinstance(color_palette, list)
609+
else color_palette,
608610
label_props={"ha": "left", **label_props},
609611
)
610612

0 commit comments

Comments
 (0)