mgyigit commited on
Commit
363f92a
1 Parent(s): b90013e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -24,8 +24,8 @@ 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 the plot
28
- plt.figure(figsize=(8, 6))
29
  for method in methods_selected:
30
  method_data = filtered_df[filtered_df['Method'] == method]
31
  plt.plot(method_data[x_metric], method_data[y_metric], label=method, marker='o')
@@ -72,14 +72,19 @@ with block:
72
  method_names = pd.read_csv(CSV_RESULT_PATH)['Method'].unique().tolist()
73
  metric_names = pd.read_csv(CSV_RESULT_PATH).columns.tolist()
74
  metric_names.remove('Method') # Remove Method from the metric options
 
 
 
 
 
 
 
75
 
76
- method_selector = gr.CheckboxGroup(choices=method_names, label="Select Methods", interactive=True)
77
- x_metric_selector = gr.Dropdown(choices=metric_names, label="Select X-axis Metric", interactive=True)
78
- y_metric_selector = gr.Dropdown(choices=metric_names, label="Select Y-axis Metric", interactive=True)
79
- plot_button = gr.Button("Plot")
80
- output_plot = gr.Image(label="Plot")
81
 
82
- plot_button.click(create_plot, inputs=[method_selector, x_metric_selector, y_metric_selector], outputs=output_plot)
83
 
84
  # Now the rest of the UI elements as they were before
85
  checkbox_group = gr.CheckboxGroup(
 
24
  df = pd.read_csv(CSV_RESULT_PATH)
25
  filtered_df = df[df['Method'].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'] == method]
31
  plt.plot(method_data[x_metric], method_data[y_metric], label=method, marker='o')
 
72
  method_names = pd.read_csv(CSV_RESULT_PATH)['Method'].unique().tolist()
73
  metric_names = pd.read_csv(CSV_RESULT_PATH).columns.tolist()
74
  metric_names.remove('Method') # Remove Method from the metric options
75
+
76
+ # Visualizer Controls: Smaller and underneath each other
77
+ with gr.Column(scale=1):
78
+ method_selector = gr.CheckboxGroup(choices=method_names, label="Select Methods", interactive=True)
79
+ x_metric_selector = gr.Dropdown(choices=metric_names, label="Select X-axis Metric", interactive=True)
80
+ y_metric_selector = gr.Dropdown(choices=metric_names, label="Select Y-axis Metric", interactive=True)
81
+ plot_button = gr.Button("Plot")
82
 
83
+ # Larger plot display
84
+ with gr.Column(scale=3):
85
+ output_plot = gr.Image(label="Plot", height=480) # Set larger height for the plot
 
 
86
 
87
+ plot_button.click(create_plot, inputs=[method_selector, x_metric_selector, y_metric_selector], outputs=output_plot)
88
 
89
  # Now the rest of the UI elements as they were before
90
  checkbox_group = gr.CheckboxGroup(