mgyigit commited on
Commit
dc9c8a6
·
verified ·
1 Parent(s): 0f606ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -7,6 +7,7 @@ import os
7
  import json
8
  import yaml
9
  import matplotlib.pyplot as plt
 
10
 
11
  from src.about import *
12
  from src.bin.PROBE import run_probe
@@ -19,21 +20,24 @@ def get_baseline_df(selected_methods, selected_metrics):
19
  df = df[df['method_name'].isin(selected_methods)][present_columns]
20
  return df
21
 
22
- # Function to create the plot
23
  def create_plot(methods_selected, x_metric, y_metric):
24
  df = pd.read_csv(CSV_RESULT_PATH)
25
- filtered_df = df[df['method_name'].isin(methods_selected)]
26
-
27
- # Create a larger plot
28
- plt.figure(figsize=(10, 8)) # Increase the figure size
29
- for method in methods_selected:
30
- method_data = filtered_df[filtered_df['method_name'] == method]
31
- plt.plot(method_data[x_metric], method_data[y_metric], label=method, marker='o')
 
 
 
 
32
 
 
33
  plt.xlabel(x_metric)
34
  plt.ylabel(y_metric)
35
  plt.title(f'{y_metric} vs {x_metric} for selected methods')
36
- plt.legend()
37
  plt.grid(True)
38
 
39
  # Save the plot to display it in Gradio
 
7
  import json
8
  import yaml
9
  import matplotlib.pyplot as plt
10
+ import seaborn as sns
11
 
12
  from src.about import *
13
  from src.bin.PROBE import run_probe
 
20
  df = df[df['method_name'].isin(selected_methods)][present_columns]
21
  return df
22
 
 
23
  def create_plot(methods_selected, x_metric, y_metric):
24
  df = pd.read_csv(CSV_RESULT_PATH)
25
+ filtered_df = df[df['Method'].isin(methods_selected)]
26
+
27
+ # Create a Seaborn lineplot with method as hue
28
+ plt.figure(figsize=(10, 8)) # Increase figure size
29
+ sns.lineplot(
30
+ data=filtered_df,
31
+ x=x_metric,
32
+ y=y_metric,
33
+ hue="Method", # Different colors for different methods
34
+ marker="o", # Add markers to the line plot
35
+ )
36
 
37
+ # Add labels and title
38
  plt.xlabel(x_metric)
39
  plt.ylabel(y_metric)
40
  plt.title(f'{y_metric} vs {x_metric} for selected methods')
 
41
  plt.grid(True)
42
 
43
  # Save the plot to display it in Gradio