uzh-rpg/rpg_trajectory_evaluation

How to modify the order of labels?

Opened this issue · 5 comments

Thank you very much for your excellent work. I would like to ask how to modify the label order displayed on the graph when validating multiple algorithms.

Hi @GuaguaguaLiu, I was able to get the labels for the plots in alphabetical order by editing the plot functions in analyze_trajectories.py

In plot_odometry_error_per_dataset()
for v in rel_err['trans_err'].keys(): => for v in sorted(rel_err['trans_err'].keys()):

In plot_trajectories()
for alg in p_es_0: => for alg in sorted(p_es_0.keys()): for both the pu.plot_trajectory_top() and pu.plot_trajectory_side() calls

Essentially, these are the few places to edit if you'd like to alter the plot/label ordering.

@kylelindgren thanks! With the latest version, you can use a yaml file to specify the algorithms and datasets to analyze (as well as the plot labels), and there is an option no_sort_names to keep the order in the yaml file (by default, the names will be sorted alphabetically).

Sounds great, but I can't seem to find ruamel.yaml anywhere. Is this not supposed to be supplied?

need to install manually unfortunately: https://pypi.org/project/ruamel.yaml/

Installed -- everything looks good now.

Thanks for the improvements to the project!