【发布时间】:2015-07-06 17:15:34
【问题描述】:
我正在尝试使用 Seaborn 的 JointGrid 绘制我的非对称数据。我可以让它使用相等的纵横比,但是我有不需要的空白:
如何删除填充? jointplot 和 JointGrid 的文档简单地说
大小:数字,可选
图形的大小(它将是正方形)。
我还尝试将extent kwarg 提供给jointplot 和JointGrid,以及ylim,但没有成功。
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
x = np.random.normal(0.0, 10.0, 1000)
y = np.random.normal(0.0, 1.0, 1000)
joint = sns.jointplot(x, y)
joint.plot_marginals(sns.distplot, kde=False)
joint.ax_joint.set_aspect('equal') # equal aspect ratio
plt.show()
【问题讨论】:
-
图形或hexbin单元格的纵横比有问题吗?
-
嗨@mwaskom,这个数字本身。我想摆脱填充并使其成为非方形,因为我的数据是我的坐标不是方形的。
-
我建议自己使用 matplotlib 命令设置图形。
标签: python matplotlib plot data-visualization seaborn