I have the following barplot in Julia Plots:
using DataFrames
using Plots
df = DataFrame(group = ["A", "B"],
value = [10, 9])
bar(df[!, "group"], df[!, "value"], legend = :none)
Output:
I would like to show the values of each bar on top of each bar. So in this example, it should show the values 10 for bar A and 9 for bar B. Is there an automatic way for this or should you annotate the values in Julia
Plots
?
An approach using annotate
.
julia> using DataFrames
julia> using Plots
julia> bar(df.group, df.value, legend = :none)
julia> annotate!(df.group, df.value, df.value, :bottom)