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).
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 tostat = "identity"
) we do not calladdZeroKeys
as we do infilledCountGeom
: https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/postprocess_scales.nim#L813Possibly 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