Fix stacked bar plot example, by using the correct starting_value#498
Conversation
|
|
||
| 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.
Is it not possible to do this without changing the input data?
There was a problem hiding this comment.
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.
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.
Agreed, that's better, made the change.
corranwebster
left a comment
There was a problem hiding this comment.
Happy to have this merged as is; feel free to modify if desired.
Fixes #444