Skip to content

Commit

Permalink
Improve readibility of polar plots
Browse files Browse the repository at this point in the history
Signed-off-by: Víctor Mayoral Vilches <[email protected]>
  • Loading branch information
vmayoral committed Sep 13, 2023
1 parent 1b21ea4 commit a6417a2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions benchmarks/other/ros2benchmark/ros2benchmark/verb/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def radar_plot_data_byhardware(data_dict, title, xlabel, ylabel, name_function=p
ax.yaxis.grid(True, color="#888888", linestyle='dashed', linewidth=0.5)
ax.spines["polar"].set_color("#222222")
ax.set_facecolor("#FAFAFA")
plt.title(title, size=14, color='black', y=1.15)
plt.title(title, size=18, color='black', y=1.15)

# filter out a common list of names, so that angles are the same for all datasets
common_names_sets = [set(name_function(d) for d in data_dict[key]) for key in data_dict.keys()]
Expand Down Expand Up @@ -817,7 +817,7 @@ def radar_plot_data_byhardware(data_dict, title, xlabel, ylabel, name_function=p
textcoords='offset points',
horizontalalignment=ha,
verticalalignment='center',
fontsize=6,
fontsize=12,
color=current_color)

# Add legend
Expand Down Expand Up @@ -867,12 +867,12 @@ def inverse_modified_log(y, a=1000):
transformed_ytick_labels = [f'{inverse_modified_log(val, a) * max_values[d["id"]]:.2f}' for val in ytick_values]
else:
transformed_ytick_labels = [f'{inverse_modified_log(val, a) * max_value:.2f}' for val in ytick_values]
ax.set_yticklabels(transformed_ytick_labels, fontsize=6)
ax.set_yticklabels(transformed_ytick_labels, fontsize=12)

# define x-ticks
ax.set_xticks(angles)
ax.set_xticklabels(names, fontsize=6)
ax.legend(loc='upper right', bbox_to_anchor=(1.1, 1.1))
ax.set_xticklabels(names, fontsize=12)
ax.legend(loc='upper right', bbox_to_anchor=(1.1, 1.1), fontsize=12)

# title and save
title_file = title.lower().replace(" ", "-")
Expand Down Expand Up @@ -1092,7 +1092,10 @@ def main(self, *, args):
colors_dict=colors_dict,
a = 500
))
benchmark_id_report += f"![{plotpath}]({plotpath}) | "
if plotpath:
benchmark_id_report += f"![{plotpath}]({plotpath}) | "
else:
benchmark_id_report += f" | "
benchmark_id_report += f"\n"

# sys.exit(0)
Expand Down

0 comments on commit a6417a2

Please sign in to comment.