在Bokeh的Seaborn剧情的X轴标签

问题描述 投票:4回答:1

我试图在散景中跟随violin plot example,但我无法在我的小提琴中添加x轴标签。根据Seaborn documentation看起来我应该能够通过“names”参数添加x轴标签,但是,以下代码不添加x轴标签:

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from bokeh import mpl
from bokeh.plotting import show

# generate some random data
data = 1 + np.random.randn(20, 6)

# Use Seaborn and Matplotlib normally
sns.violinplot(data, color="Set3", names=["kirk","spock","bones","scotty","uhura","sulu"])
plt.title("Seaborn violin plot in Bokeh")

# Convert to interactive Bokeh plot with one command
show(mpl.to_bokeh(name="violin"))

我相信问题在于我将一个数字从seaborn转换为matplotlib到散景,但我不确定x轴标签的位置。

我已经确认标签在转换为散景之前出现在matplotlib中。我还尝试在转换后将标签添加到散景中,但这会导致一个奇怪的情节。我已经为散景开发者here创建了这个问题。

matplotlib bokeh seaborn
1个回答
0
投票

编辑:我不确定为什么下面的答案被移到评论。作为项目维护者,这就是答案,即:不再可能自动转换Seaborn,因为该功能不再是库的一部分。没有其他答案可以给予。它没有为项目或用户社区提供服务来掩盖这一事实。


自Bokeh 12.5(2017年4月),support for Matplotlib has been deprecated,所以mpl.to_bokeh()不再可用。

© www.soinside.com 2019 - 2024. All rights reserved.