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

Order of colors in dodged bar plot? #588

Closed
JackDunnNZ opened this issue Apr 29, 2015 · 0 comments · Fixed by #1240
Closed

Order of colors in dodged bar plot? #588

JackDunnNZ opened this issue Apr 29, 2015 · 0 comments · Fixed by #1240

Comments

@JackDunnNZ
Copy link

The ordering of colors when drawing a dodged bar plot seems to be reversed compared to the legend.

Using the example from the julialang.org benchmark plot but modifying the last line to make it a dodged bar plot:

p = plot(benchmarks,
    x = :language,
    y = :time,
    color = :benchmark,
    Scale.y_log10,
    Guide.ylabel(nothing),
    Guide.xlabel(nothing),
    Theme(
        default_point_size = 1mm,
        guide_title_position = :left,
        colorkey_swatch_shape = :circle,
        minor_label_font = "Georgia",
        major_label_font = "Georgia",
    ),
    Geom.bar(position=:dodge),
)

draw(SVG("_includes/benchmarks.svg", 8inch, 8inch/golden), p)

Produces the following plot:

screen shot 2015-04-29 at 3 42 45 pm

mandel is the first listed in the legend, but is the rightmost bar in each language. I would have expected the bars to be ordered left to right in accordance with the legend order, but it seems the reverse is the case?

@Mattriks Mattriks mentioned this issue Jan 8, 2019
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant