As mentioned, I wanted to plot a groupedbar
using StatsPlots
in Julia. Here is my code:
legends = repeat(["myopic baseline", "vfa", "lvfa", "nnvfa", "nnvfa with attention"], outer=2)
training_time_per_step = [0., 9.817792895793914, 6.380393509864807, 15.770121607780457, 31.79437662124634]
eval_time_per_step = [2.756498346328735, 6.823106627861659, 6.184429474310442, 13.286595929535952, 20.297245191227304]
ctg = repeat(["training time per step", "eval time per step"], inner = 5)
bar1 = groupedbar(legends, vcat(training_time_per_step, eval_time_per_step), group=ctg, xlabel="Methods", ylabel="Time",
title="Time Evaluation", legend=:topleft, reuse=false)
display(bar1)
I want the legends to have the same order as I defined, but I find it is automatically ordered by the name of each legend:
How can I solve this problem?