Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation in bars #521

Open
alfaromartino opened this issue Jan 13, 2022 · 0 comments
Open

Annotation in bars #521

alfaromartino opened this issue Jan 13, 2022 · 0 comments
Labels

Comments

@alfaromartino
Copy link

alfaromartino commented Jan 13, 2022

I wasn't sure if I should post this here or StatsPlots, but this issue is the same as in JuliaPlots/Plots.jl#3574.
If you add numbers to each bar in groupedbar, it always repeats the numbers of the first group. The error was reproduced in pgfplotsx, pyplot, gr, and plotly as backends.

MWE:

using StatsPlots

x=["A","A","B","B"]
y=[1,2,3,4]
year=["2020","2021","2020","2021"]

groupedbar(x,y,group=year,bar_width=0.7,series_annotations=y)

which gives as result
blah

The location of the annotation is also wrong, (which is the same as issue JuliaPlots/Plots.jl#3574). I've been using the following workaround, and the problem is the same.

groupedbar(x,y,group=year,bar_width=0.7)
groupedbar!(x,y./2,group=year,bar_width=0.7,
alpha = 0.0,label="",series_annotations=[1 2 3 4],legend=:outertopright)

which gives
blah2

@t-bltg t-bltg transferred this issue from JuliaPlots/Plots.jl Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant