1
Fork 0

feat(plotting): removed best marker legend entry

This commit is contained in:
Robin Meersman 2026-05-19 10:16:18 +02:00
parent f4ed621a61
commit 2493c8d2b3
2 changed files with 19 additions and 10 deletions

View file

@ -6,18 +6,17 @@ Rate, Distance Remaining).
""" """
import os import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from plot_config import ( from plot_config import (
COLORS,
apply_style,
BEST_PERFORMER_MARKER,
BEST_PERFORMER_TEXT,
BEST_PERFORMER_COLOR, BEST_PERFORMER_COLOR,
create_common_parser, BEST_PERFORMER_TEXT,
COLORS,
LEGEND_KWARGS, LEGEND_KWARGS,
apply_style,
create_common_parser,
) )
@ -362,8 +361,8 @@ if __name__ == "__main__":
plot_grouped_bar( plot_grouped_bar(
df=df, df=df,
metric_col="approx_max_velocity", metric_col="approx_max_velocity",
ylabel="Max Forward Velocity (cm/s)", ylabel="",
title="Graceful Degradation: Velocity Across Morphologies", title="Maximal forward velocity (in cm/s)",
output_filename="poster_plot_velocity.png", output_filename="poster_plot_velocity.png",
output_dir=OUTPUT_DIR, output_dir=OUTPUT_DIR,
higher_is_better=True, higher_is_better=True,

View file

@ -135,6 +135,9 @@ def load_metrics(file_mapping: dict[str, str]) -> pd.DataFrame:
continue continue
df = df[required].copy() df = df[required].copy()
df[Columns.VELOCITY] = (df[Columns.INITIAL_XY_DIST] - df[Columns.FINAL_XY_DIST]) / df[
Columns.EVAL_STEPS
]
df[Columns.ARCH] = arch_name df[Columns.ARCH] = arch_name
df[Columns.VELOCITY] = (df[Columns.INITIAL_XY_DIST] - df[Columns.FINAL_XY_DIST]) / df[ df[Columns.VELOCITY] = (df[Columns.INITIAL_XY_DIST] - df[Columns.FINAL_XY_DIST]) / df[
Columns.EVAL_STEPS Columns.EVAL_STEPS
@ -165,6 +168,8 @@ def analyze_convergence(df: pd.DataFrame) -> pd.DataFrame:
""" """
results = [] results = []
centralized_base = 0
for arch in df[Columns.ARCH].unique(): for arch in df[Columns.ARCH].unique():
arch_data = df[df[Columns.ARCH] == arch].sort_values(Columns.TIMESTEPS) arch_data = df[df[Columns.ARCH] == arch].sort_values(Columns.TIMESTEPS)
@ -192,6 +197,11 @@ def analyze_convergence(df: pd.DataFrame) -> pd.DataFrame:
} }
) )
if arch == "centralized 5 arms":
centralized_base = reward_checkpoint
else:
print(arch, "speedup:", 1 - reward_checkpoint / centralized_base)
return pd.DataFrame(results) return pd.DataFrame(results)