简体   繁体   English

在分组箱图上叠加散点图

[英]Overlaying scatter plot on grouped box-plot

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: 当箱形图具有单个x轴时,这可以正常工作:

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)

散点图覆盖在箱形图上


The scatter plot overlay no longer works when I add a second variable to group the x-axis values: 当我添加第二个变量来对x轴值进行分组时,散点图叠加不再有效:

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)

散布图叠加在分组框图上

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. 在平移到图的左侧时,也可以看到绘制的散点,具有正确的y轴值但是“不正确的”未标记的x轴值。

散点图覆盖在分组的箱形图上,不正确的x轴

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? 有没有办法在框图上叠加散点图,使它们的x轴值与现有的分组x轴值匹配?

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: 整个bokeh.charts API,包括BoxPlot被否定并取消2017年对于一个非常高的水平,可组合的API包括BoxWhisker ,检查出HoloViews,这是建立在背景虚化的顶部:

http://holoviews.org http://holoviews.org

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM