繁体   English   中英

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

[英]Plotting 2 seaborn KDE joint plots in the same row

有没有办法并排绘制两个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])

但是在指定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])

我明白了:

      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()接受的参数?

jointplot是一个图级功能 ,不能与其他图共存,但有一个kdeplot函数可以将2-d KDE绘制到特定的Axes上。 这个例子

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM