Shanshan Wang commited on
Commit
95212cd
·
1 Parent(s): 5c51e60

color change

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -34,12 +34,13 @@ def categorize_model(model):
34
  else:
35
  return "Other"
36
 
 
 
37
 
38
  # Apply the categorization to create a new column
39
  data_valid["Category"] = data_valid["Model"].apply(categorize_model)
40
 
41
 
42
-
43
  # ploting
44
  def plot_metric(selected_metric):
45
  filtered_data = data_valid[data_valid[selected_metric] !=0 ]
@@ -51,7 +52,8 @@ def plot_metric(selected_metric):
51
  y=selected_metric,
52
  text="Model",
53
  color="Category", # Different color for Special and Other categories
54
- title=f"{selected_metric} vs Model Size"
 
55
  )
56
 
57
  fig.update_traces(marker=dict(size=10), mode='markers+text', textposition="middle right", textfont=dict(size=10))
 
34
  else:
35
  return "Other"
36
 
37
+ # Define a color map with yellow for "H2OVLs"
38
+ color_map = {"H2OVLs": "#FFE600", "Other": "#0047AB", "traditional ocr models": "#00A36C"}
39
 
40
  # Apply the categorization to create a new column
41
  data_valid["Category"] = data_valid["Model"].apply(categorize_model)
42
 
43
 
 
44
  # ploting
45
  def plot_metric(selected_metric):
46
  filtered_data = data_valid[data_valid[selected_metric] !=0 ]
 
52
  y=selected_metric,
53
  text="Model",
54
  color="Category", # Different color for Special and Other categories
55
+ title=f"{selected_metric} vs Model Size",
56
+ color_discrete_map=color_map
57
  )
58
 
59
  fig.update_traces(marker=dict(size=10), mode='markers+text', textposition="middle right", textfont=dict(size=10))