Skip to content
Snippets Groups Projects
Commit c8ff683e authored by Hu Marilyne's avatar Hu Marilyne
Browse files

change utils_graph.py

parent e3b03866
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -124,6 +124,8 @@ def display() :
# Premier tracé pour générer list_colors
model_graph.barh_subplot(colors=col_color, show=False, title= title, xlabel= xlabel, ylabel=ylabel)
legend_title = st.text_input('Saisir le nom de la légende :', key='legend_title')
colors_rgba = model_graph.list_colors
custom_colors = {}
......@@ -149,7 +151,7 @@ def display() :
barh = model_graph.barh_subplot(
colors=col_color,
legend_list=legend_labels,
title_legend="gende",
title_legend= legend_title,
legend_indices=legend_indices,
title= title,
xlabel= xlabel,
......
No preview for this file type
......@@ -6,7 +6,7 @@ import matplotlib.patches as mpatches
# partie sur les légendes à revoir
c_map = ['#000091', '#AB0345']
c_map = ['#7DC2A5', '#C7DDC5','#F1F1D3', '#D7B4BF', '#A1B3D1','#82C9D1', '#56B8D1']
cmap = LinearSegmentedColormap.from_list("custom_cmap", c_map)
class plot_graph() :
......@@ -77,6 +77,9 @@ class plot_graph() :
self.ax.grid(axis='x', linestyle='-', alpha=0.2)
self.ax.spines['top'].set_visible(False)
self.ax.spines['right'].set_visible(False)
plt.tight_layout()
if show :
......@@ -119,7 +122,7 @@ class plot_graph() :
if selection :
for bar, label in zip(self.bars,self.y):
if label in selection:
bar.set_edgecolor('#FCA616')
bar.set_edgecolor('black')
bar.set_linewidth(3)
return self.fig
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment