【发布时间】:2016-12-08 09:37:08
【问题描述】:
从seaborn tutorial我已经绘制了一个情节:
import seaborn as sns
sns.set_style("whitegrid")
tips = sns.load_dataset("tips")
ax = sns.swarmplot(x=tips["total_bill"])
现在我想拥有包含make in interactive using mpld3 数据的 PathCollection 句柄。我查看输出axchildren,我得到以下列表:
[<matplotlib.collections.PathCollection at 0x7828d325f8>,
<matplotlib.spines.Spine at 0x782824a518>,
<matplotlib.spines.Spine at 0x782824ab38>,
<matplotlib.spines.Spine at 0x782824a748>,
<matplotlib.spines.Spine at 0x782824a940>,
<matplotlib.axis.XAxis at 0x782824acf8>,
<matplotlib.axis.YAxis at 0x78282e5518>,
<matplotlib.text.Text at 0x78282fb710>,
<matplotlib.text.Text at 0x78282fb0b8>,
<matplotlib.text.Text at 0x78282fb208>,
<matplotlib.patches.Rectangle at 0x78282fb0f0>]
但是,当我在 PathCollection 中查找数据时,它是空的
ax.get_children()[0].get_array()
如何找到包含数据点的 PathCollection 的句柄?
【问题讨论】:
标签: python matplotlib plot seaborn