可视化数据,跟踪特定的 SD 值
Visualizing Data, Tracking Specific SD Values
BLUF:我想跟踪特定的 Std Dev,例如1.0 到 1.25,通过颜色编码并制作单独的 KDF 或其他概率密度图。
我想用它做的是能够挑选出其他 Std Dev 范围并取回新图表,我可以将其转换并用于预测该特定 Std Dev 的结果。
数据:https://www.dropbox.com/s/y78pynq9onyw9iu/Data.csv?dl=0
到目前为止,我得到的是看起来像霰弹枪爆炸的标准化数据:
用于生成它的代码:
data = pd.read_csv("Data.csv")
sns.jointplot(data.x,data.y, space=0.2, size=10, ratio=2, kind="reg");
我想在这里实现的看起来像我在下面标记的那样:
我有点知道如何在 RStudio 中使用 RidgePlot 类型的函数来执行此操作,但我在 Python 中不知所措,即使在使用 Seaborn 时也是如此。 Any/All 帮助感激不尽!
下面的代码可能会直接指向你,你可以从那里随意调整情节的外观。
tips = sns.load_dataset("tips")
g = sns.jointplot(x="total_bill", y="tip", data=tips)
top_lim = 4
bottom_lim = 2
temp = tips.loc[(tips.tip>=bottom_lim)&(tips.tip<top_lim)]
g.ax_joint.axhline(top_lim, c='k', lw=2)
g.ax_joint.axhline(bottom_lim, c='k', lw=2)
# we have to create a secondary y-axis to the joint-plot, otherwise the
# kde might be very small compared to the scale of the original y-axis
ax_joint_2 = g.ax_joint.twinx()
sns.kdeplot(temp.total_bill, shade=True, color='red', ax=ax_joint_2, legend=False)
ax_joint_2.spines['right'].set_visible(False)
ax_joint_2.spines['top'].set_visible(False)
ax_joint_2.yaxis.set_visible(False)
BLUF:我想跟踪特定的 Std Dev,例如1.0 到 1.25,通过颜色编码并制作单独的 KDF 或其他概率密度图。
我想用它做的是能够挑选出其他 Std Dev 范围并取回新图表,我可以将其转换并用于预测该特定 Std Dev 的结果。
数据:https://www.dropbox.com/s/y78pynq9onyw9iu/Data.csv?dl=0
到目前为止,我得到的是看起来像霰弹枪爆炸的标准化数据:
用于生成它的代码:
data = pd.read_csv("Data.csv")
sns.jointplot(data.x,data.y, space=0.2, size=10, ratio=2, kind="reg");
我想在这里实现的看起来像我在下面标记的那样:
我有点知道如何在 RStudio 中使用 RidgePlot 类型的函数来执行此操作,但我在 Python 中不知所措,即使在使用 Seaborn 时也是如此。 Any/All 帮助感激不尽!
下面的代码可能会直接指向你,你可以从那里随意调整情节的外观。
tips = sns.load_dataset("tips")
g = sns.jointplot(x="total_bill", y="tip", data=tips)
top_lim = 4
bottom_lim = 2
temp = tips.loc[(tips.tip>=bottom_lim)&(tips.tip<top_lim)]
g.ax_joint.axhline(top_lim, c='k', lw=2)
g.ax_joint.axhline(bottom_lim, c='k', lw=2)
# we have to create a secondary y-axis to the joint-plot, otherwise the
# kde might be very small compared to the scale of the original y-axis
ax_joint_2 = g.ax_joint.twinx()
sns.kdeplot(temp.total_bill, shade=True, color='red', ax=ax_joint_2, legend=False)
ax_joint_2.spines['right'].set_visible(False)
ax_joint_2.spines['top'].set_visible(False)
ax_joint_2.yaxis.set_visible(False)