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

geom_bar with stat="identity" and position="stack" broken if some fields missing #141

Open
Vindaar opened this issue Jan 8, 2022 · 0 comments

Comments

@Vindaar
Copy link
Owner

Vindaar commented Jan 8, 2022

When using geom_bar with already computed statistics and stacking them based on some additional fill column (different groups by color), the generation of the plot can fail if not every group is present in each "stack" (has a value for each label of the fill column).

This is because in filledIdentityGeom (called due to stat = "identity") we do not call addZeroKeys as we do in filledCountGeom:
https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/postprocess_scales.nim#L813

Possibly the fix is as simple as adding such a call to the "stack" logic here:
https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/postprocess_scales.nim#L467

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

No branches or pull requests

1 participant