-
Notifications
You must be signed in to change notification settings - Fork 99
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 stacked bar plot example, by using the correct starting_value #498
Conversation
@@ -47,7 +47,7 @@ def __init__(self, index, series_a, series_b, series_c, **kw): | |||
|
|||
|
|||
index = numpy.array([1,2,3,4,5]) | |||
demo = PlotExample(index, index*10, index*5, index*2) | |||
demo = PlotExample(index, index*10, index*15, index*17) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not possible to do this without changing the input data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring for starting_value
says the following:
#: The data source to use as "starting" values for bars (along value axis).
#: For instance, if the values are [10, 20] and starting_value
#: is [3, 7], BarPlot will plot two bars, one between 3 and 10, and
#: one between 7 and 20
I think BarPlot
is designed not to change the value when stacking, so the user may have to do it explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could reverse the input data instead. The original version of this relied on the rendering order (the tallest bar was drawn first, etc.).
Even better might be to sum the data as part of the process of creating the plots (ie. barplot 1 is from 0 to series_a
, barplot 2 is from series_a
to series_a + series_b
, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, that's better, made the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to have this merged as is; feel free to modify if desired.
Fixes #444