uzh-rpg / rpg_trajectory_evaluation

Toolbox for quantitative trajectory evaluation of VO/VIO
MIT License
1.06k stars 348 forks source link

How to modify the order of labels? #15

Open GuaguaguaLiu opened 5 years ago

GuaguaguaLiu commented 5 years ago

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.

kylelindgren commented 5 years ago

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.

zhangzichao commented 4 years ago

@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).

kylelindgren commented 4 years ago

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

zhangzichao commented 4 years ago

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

kylelindgren commented 4 years ago

Installed -- everything looks good now.

Thanks for the improvements to the project!