【发布时间】:2014-12-08 00:14:03
【问题描述】:
我正在尝试在名为 seaborn 的包(matplotlib 上的包装器)中绘制 2 个变量的联合分布。最终,我想得到这样的东西:http://web.stanford.edu/~mwaskom/software/seaborn/examples/hexbin_marginals.html
问题是当我传递不同长度的数组时,seaborn 会对我发誓。假设,
var1 = [1,1,1,1,1,2,2,2,2,3,3,5,7]
var2 = [1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,9,10,13]
如果我这样写:
import seaborn as sns
sns.jointplot(var1, var2, kind='hex')
它抛出
ValueError: operands could not be broadcast together with shapes (13) (20)
任何人都知道如何让 seaborn 与此调和吗?
【问题讨论】:
标签: python matplotlib pandas visualization seaborn