创建一个小提琴情节的正确方法是hue
什么?
我尝试了不同的方法,似乎唯一的方法是为数据集中的每个条目创建一个共享相同值的特征。并将该功能的名称传递为x
.
fig = plt.figure(figsize=(20, 8))
fig.add_subplot(1, 3, 1)
ax = sns.violinplot(x='feature', y='height',
data=train_cleansed_height,
scale='count',
hue='feature', split=True,
palette='seismic',
inner='quartile')
fig.add_subplot(1, 3, 2)
ax = sns.violinplot(x='workaround', y='height',
data=train_cleansed_height,
scale='count',
hue='feature', split=True,
palette='seismic',
inner='quartile')
fig.add_subplot(1, 3, 3)
ax = sns.violinplot(x=None, y='height',
data=train_cleansed_height,
scale='count',
hue='feature', split=True,
palette='seismic',
inner='quartile')
plt.xlabel('x=None')
但这是正确的方法吗?