You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that whenever I try to use the bokeh.charts.BoxPlot function I hit an error with plots with more than 6 boxplots.
import numpy as np from bokeh.charts import BoxPlot test = {} for i in range(0,7): test[str(i)] = np.random.normal(0,1,100) plot = BoxPlot(test) show(plot)
This is the resulting stacktrace:
Traceback (most recent call last): File "temp.py", line 6, in <module> plot = BoxPlot(test) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/builder/boxplot_builder.py", line 84, in BoxPlot xscale=xscale, yscale=yscale, xgrid=xgrid, ygrid=ygrid, **kw File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_builder.py", line 42, in create_and_build chart.add_builder(builder) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_chart.py", line 118, in add_builder builder.create(self) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_builder.py", line 169, in create chart.add_renderers(self, renderers) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_chart.py", line 113, in add_renderers self.renderers += renderers File "/usr/local/lib/python2.7/site-packages/bokeh/charts/builder/boxplot_builder.py", line 283, in _yield_renderers line_color="black", fill_color=self.palette[i]) IndexError: list index out of range
It appears that whatever predefined color list for the BoxPlot function has run out of colors for new boxplots.
Is there a way to either define a new color list (ideally, a cycle that will simply repeat colors if it runs out) or disable coloring entirely?
The text was updated successfully, but these errors were encountered:
This is definitely a bug but you can bypass it by specifying a custom palette all the colors you want. If you specify a palette long enough you'll avoid stepping this bug. Here's a quick workaround to make your code work while this isn't fixed:
I noticed that whenever I try to use the bokeh.charts.BoxPlot function I hit an error with plots with more than 6 boxplots.
import numpy as np from bokeh.charts import BoxPlot test = {} for i in range(0,7): test[str(i)] = np.random.normal(0,1,100) plot = BoxPlot(test) show(plot)
This is the resulting stacktrace:
Traceback (most recent call last): File "temp.py", line 6, in <module> plot = BoxPlot(test) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/builder/boxplot_builder.py", line 84, in BoxPlot xscale=xscale, yscale=yscale, xgrid=xgrid, ygrid=ygrid, **kw File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_builder.py", line 42, in create_and_build chart.add_builder(builder) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_chart.py", line 118, in add_builder builder.create(self) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_builder.py", line 169, in create chart.add_renderers(self, renderers) File "/usr/local/lib/python2.7/site-packages/bokeh/charts/_chart.py", line 113, in add_renderers self.renderers += renderers File "/usr/local/lib/python2.7/site-packages/bokeh/charts/builder/boxplot_builder.py", line 283, in _yield_renderers line_color="black", fill_color=self.palette[i]) IndexError: list index out of range
It appears that whatever predefined color list for the BoxPlot function has run out of colors for new boxplots.
Is there a way to either define a new color list (ideally, a cycle that will simply repeat colors if it runs out) or disable coloring entirely?
The text was updated successfully, but these errors were encountered: