在同一行绘制2个seaborn KDE联合图

Lui*_*uel 7 python matplotlib seaborn

有没有办法并排绘制两个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])
Run Code Online (Sandbox Code Playgroud)

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

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])
Run Code Online (Sandbox Code Playgroud)

我明白了:

      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' 
Run Code Online (Sandbox Code Playgroud)

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

mwa*_*kom 7

jointplot是一个图级功能,不能与其他图共存,但有一个kdeplot功能可以将二维KDE绘制到特定的轴上.看这个例子.