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

Fix ArgumentError when plotting Geom.bar with empty array of values #838

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

JohnHBrock
Copy link
Contributor

The below code was resulting in ArgumentError: reducing over an empty collection is not allowed because there is no value where category1 is B and category2 is Y.

using Gadfly

Gadfly.plot(x=[1, 4, 2],
            y=[5, 7, 3],
            xgroup=["A", "A", "B"],
            ygroup=["X", "Y", "Y"],
            Geom.subplot_grid(Geom.bar))

I fixed this by copying the logic used in the HistogramStatistic version of apply_statistic and added a test.

@coveralls
Copy link

coveralls commented May 6, 2016

Coverage Status

Coverage increased (+2.4%) to 65.442% when pulling 9960d63 on JohnHBrock:pull-request/9960d63f into 91fb468 on dcjones:master.

@tlnagy
Copy link
Member

tlnagy commented Sep 1, 2016

Thanks for this fix, I'm rebooting travis and I'll merge this once tests pass. Sorry this took so long!

@tlnagy tlnagy merged commit 92c318c into GiovineItalia:master Sep 1, 2016
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 this pull request may close these issues.

None yet

3 participants