Add stack=:dodge and stack=:waterfall to barplot to allow easy waterfall charts creation
#2314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the options
I frequently use what some people call waterfall charts (plotly, python) to visualize individual positive and negative components that add up to a net result.
Suppose I have a vector
yof such components and colorscto indicate the sign.To achieve something similar with Makie I can recalculate stacked
yvalues and correspondingfilltovalues.With this PR I can do the same thing with just:
Now suppose I want to compare multiple net results grouped by
xwith individual components grouped bydodge.Here I have to preprocess my data in some way like this:
It would be even more cumbersome if
xanddodgewere not sorted properly. This PR enables me to just use:I'm not really sure about the name choices
:waterfalland:dodgethough and open to better suggestions.Something similar was also asked for in https://discourse.julialang.org/t/waterfall-plot-makie-jl/79988.
Type of change
Delete options that do not apply:
Checklist