1

我试图在Bokeh中使用小提琴图表,但找不到这种类型的图表。因此,我使用seaborn库构建小提琴图并将其用于bokeh

代码:

import seaborn as sns
from bokeh import mpl
import pandas as pd
df = pd.DataFrame({"x": [1,1,1,2], "y":4,5,8,9})
sns.violinplot(x="x", y="y", data=df)
plot = mpl.to_bokeh()
plot.plot_width = 500
plot.plot_height = 300

现在,我想在seaborn的散景转换图表上添加工具提示。我google了很多,但找不到方法。

4

1 回答 1

0

这不再可能,至少在这种形式下是不可能的。散景中的 MPL 兼容性,包括mpl.to_bokeh()前一段时间已弃用并完全删除。您可能会看一下Holoviews,它是一个构建在 Bokeh 之上的非常高级的 API,我相信它只是添加了一个小提琴图。

于 2018-06-07T08:35:41.267 回答