8

有没有办法并排绘制两个 KDE 联合图?我已经能够显示 seaborn 可以使用以下方法生成的几乎所有类型的图表:

power_t_series = sDF.pitch
velocity_t_series = sDF.velocity
duration_t_series = sDF.duration

figure, axes = plt.subplots(nrows=1, ncols=2)
figure.set_size_inches(20,10)
b, g = sns.color_palette("muted", 2)

sns.tsplot(power_t_series, color = b, ax=axes[0])
sns.distplot(power_t_series, color = r, ax=axes[1])

但是在指定联合图时,自上而下是显示这种性质的多个图表的唯一方法吗?这是代码和错误:

figure, axes = plt.subplots(nrows=1, ncols=2)
figure.set_size_inches(20,10)
b, g = sns.color_palette("muted", 2)

sns.jointplot(power_t_series, velocity_t_series, kind='kde', ax=axes[0])
sns.jointplot(power_t_series, duration_t_series, kind='kde', ax=axes[1])

我明白了:

      3 b, g = sns.color_palette("muted", 2)
      4 
----> 5 sns.jointplot(power_t_series, velocity_t_series, kind='kde', ax=axes[0])
      6 sns.jointplot(power_t_series, duration_t_series, kind='kde', ax=axes[1])

TypeError: jointplot() got an unexpected keyword argument 'ax' 

有没有办法并排绘制这种类型的图表,因为 ax 不是jointplot() 接受的参数?

4

1 回答 1

8

jointplot是一个图形级函数,不能与其他图形共存,但有一个kdeplot函数可以将二维 KDE 绘制到特定轴上。请参阅此示例

于 2014-09-14T23:59:41.903 回答