From ddba72700b967831cf69591e4fb7d93ea739920a Mon Sep 17 00:00:00 2001 From: Panagiotis Anagnostou Date: Mon, 1 Jul 2024 15:21:59 +0300 Subject: [PATCH] Change in the colormap call method of the interactive visualization --- src/HiPart/interactive_visualization.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/HiPart/interactive_visualization.py b/src/HiPart/interactive_visualization.py index f5f6851..c3fbb9c 100644 --- a/src/HiPart/interactive_visualization.py +++ b/src/HiPart/interactive_visualization.py @@ -347,7 +347,7 @@ def Splitpoint_Manipulation_Callback( category_order = { "cluster": [str(i) for i in range(len(np.unique(data_matrix["cluster"])))] } - color_map = matplotlib.cm.get_cmap("tab20", number_of_nodes) + color_map = matplotlib.colormaps["tab20"].resampled(number_of_nodes) colList = {str(i): _convert_to_hex(color_map(i)) for i in range(color_map.N)} with open(data["new_input_object"], "rb") as cls_file: @@ -420,7 +420,8 @@ def Splitpoint_Manipulation_Callback( order = { "cluster": [str(i) for i in range(len(np.unique(data_matrix["cluster"])))] } - map = matplotlib.cm.get_cmap("tab20", number_of_nodes) + + map = matplotlib.colormaps["tab20"].resampled(number_of_nodes) color_list = {str(i): _convert_to_hex(map(i)) for i in range(map.N)} with open(data["new_input_object"], "rb") as obj_file: