I want to add data labels to the bars of my bar plot, as seen here:
(chart and python code accessible here
How do I do it? Right now what I have is:
plotly()
y = rand(5)
x = string.([1,2,3,4,5])
using Plots
bar = plot(x, y, st = :bar, txt = x)
which returns:
Note that if I change st = :bar
to st = :scatter
, it works as expected:
plotly()
y = rand(5)
x = string.([1,2,3,4,5])
using Plots
scatter = plot(x, y, st = :scatter, txt = x)
(well, I’d like the labels to not overlap with the markers but I guess that is easy to change)