Skip to content

Commit

Permalink
Merge pull request #561 from MLecardonnel/fix/color_style
Browse files Browse the repository at this point in the history
Fix color style.
  • Loading branch information
guillaume-vignal authored Jul 4, 2024
2 parents b568987 + c79861b commit 14a9bc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions shapash/explainer/smart_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3645,7 +3645,7 @@ def _prediction_classification_plot(
x=df_correct_predict["target"].values.flatten() + np.random.normal(0, 0.02, len(df_correct_predict)),
y=df_correct_predict["proba_values"].values.flatten(),
mode="markers",
marker_color=self._style_dict["prediction_plot"][0],
marker_color=self._style_dict["prediction_plot"][1],
showlegend=True,
name="Correct Prediction",
hovertext=hv_text_correct_predict,
Expand All @@ -3659,7 +3659,7 @@ def _prediction_classification_plot(
x=df_wrong_predict["target"].values.flatten() + np.random.normal(0, 0.02, len(df_wrong_predict)),
y=df_wrong_predict["proba_values"].values.flatten(),
mode="markers",
marker_color=self._style_dict["prediction_plot"][1],
marker_color=self._style_dict["prediction_plot"][0],
showlegend=True,
name="Wrong Prediction",
hovertext=hv_text_wrong_predict,
Expand Down
7 changes: 4 additions & 3 deletions shapash/style/style_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
functions for loading and manipulating colors
"""

import json
import os

Expand Down Expand Up @@ -100,11 +101,11 @@ def define_style(palette):
1: {"color": featureimp_bar[1], "line": {"color": palette["featureimp_line"], "width": 0.5}},
2: {"color": featureimp_bar[2]},
}
style_dict["featureimp_groups"] = list(palette["featureimp_groups"].values())
style_dict["featureimp_groups"] = convert_string_to_int_keys(palette["featureimp_groups"])
style_dict["init_contrib_colorscale"] = palette["contrib_colorscale"]
style_dict["contrib_distribution"] = palette["contrib_distribution"]
style_dict["violin_area_classif"] = list(palette["violin_area_classif"].values())
style_dict["prediction_plot"] = list(palette["prediction_plot"].values())
style_dict["violin_area_classif"] = convert_string_to_int_keys(palette["violin_area_classif"])
style_dict["prediction_plot"] = convert_string_to_int_keys(palette["prediction_plot"])
style_dict["violin_default"] = palette["violin_default"]
style_dict["dict_title_compacity"] = {"font": {"size": 14, "family": "Arial", "color": palette["title_color"]}}
style_dict["dict_xaxis"] = {"font": {"size": 16, "family": "Arial Black", "color": palette["axis_color"]}}
Expand Down

0 comments on commit 14a9bc8

Please sign in to comment.