From bcc4b8c9a3d8dd72e1daa75a07006f5c30aff322 Mon Sep 17 00:00:00 2001 From: Youqing Xiaozhua <843213558@qq.com> Date: Fri, 10 May 2024 14:56:39 +0000 Subject: [PATCH 1/2] BUGFIX: line_kws.color is of no effect --- seaborn/distributions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seaborn/distributions.py b/seaborn/distributions.py index f8ec166cf4..4609223040 100644 --- a/seaborn/distributions.py +++ b/seaborn/distributions.py @@ -647,7 +647,8 @@ def plot_univariate_histogram( line_args = density, support sticky_x, sticky_y = (0, np.inf), None - line_kws["color"] = to_rgba(sub_color, 1) + line_color = line_kws.get('color', sub_color) + line_kws["color"] = to_rgba(line_color, 1) line, = ax.plot( *line_args, **line_kws, ) From 81ff4a6714d6ffad405c1df0dbf84cfaebe693a7 Mon Sep 17 00:00:00 2001 From: Youqing Xiaozhua <843213558@qq.com> Date: Sat, 25 May 2024 15:45:39 +0000 Subject: [PATCH 2/2] fix overwrite hue line color --- seaborn/distributions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/seaborn/distributions.py b/seaborn/distributions.py index 4609223040..663fcea6ed 100644 --- a/seaborn/distributions.py +++ b/seaborn/distributions.py @@ -545,6 +545,7 @@ def plot_univariate_histogram( hist_artists = [] # Go back through the dataset and draw the plots + custome_line_color = line_kws.get('color') for sub_vars, _ in self.iter_data("hue", reverse=True): key = tuple(sub_vars.items()) @@ -647,7 +648,10 @@ def plot_univariate_histogram( line_args = density, support sticky_x, sticky_y = (0, np.inf), None - line_color = line_kws.get('color', sub_color) + if custome_line_color is None: + line_color = sub_color + else: + line_color = custome_line_color line_kws["color"] = to_rgba(line_color, 1) line, = ax.plot( *line_args, **line_kws,