1
votes

I am trying to overlay a scatter plot on a box-plot using bokeh. This works fine when the box-plot has a single x-axis:

plot = BoxPlot(source.data, source=source, values='y', label='x0', \
               legend=False, outliers=False, color='lightgray', \
               whisker_color='darkgray', palette=palette_colors) 
# Add scatter overlay
plot.circle(source=source, x='x0', y='y', color='color', legend=False)

Scatter plot overlaid on box-plot


The scatter plot overlay no longer works when I add a second variable to group the x-axis values:

plot = BoxPlot(source.data, source=source, values='y', label=['x0', 'x1'], \
               legend=False, outliers=False, color='lightgray', \
               whisker_color='x0', palette=palette_colors) 
# Add scatter overlay
plot.circle(source=source, x='x0', y='y', color='color', legend=False)

Scatter plot overlaid on grouped box-plot

On panning to the left of the plot, the plotted scatter points can be seen as well, with correct y-axis values but an 'incorrect' unlabeled x-axis value.

Scatter plot overlaid on grouped box-plot, incorrect x-axis

Is there a way to overlay the scatter points over the box-plot so that their x-axis values match with the existing grouped x-axis values?

1
Thanks for your suggestion. The question refers to plotting with bokeh though. I will update the question to clarify this.Spry

1 Answers

0
votes

The entire bokeh.charts API, including BoxPlot was deprecated and removed in 2017. For a very high level, composable API that includes a BoxWhisker, check out HoloViews, which is built on top of Bokeh:

http://holoviews.org