我想用sqft_living x price用散点图绘制一些数据并使用" hue ="看模式......但我没有。
plt.figure(figsize = (12,8))
plt.subplots_adjust(hspace = 0.4, top = 0.8)
ax1 = plt.subplot(221)
ax1 = sns.countplot(x="bathrooms", data=df_usa,
ax=ax1)
ax1.set_xticklabels(ax1.get_xticklabels(),rotation=90)
ax1.set_title("Bathrooms counting", fontsize=15)
ax1.set_xlabel("Bathrooms number")
ax1.set_ylabel("count")
ax2 = plt.subplot(222)
ax2 = sns.boxplot(x="bathrooms", y='price', jitter=True,
data=df_usa, ax=ax2)
ax2.set_xticklabels(ax2.get_xticklabels(),rotation=90)
ax2.set_title("Bathrooms distribution price", fontsize=15)
ax2.set_xlabel("Bathrooms number")
ax2.set_ylabel("log Price(US)")
ax0 = plt.subplot(212)
ax0 = sns.regplot(x="sqft_living", y="price", #I need to add hue="bathrooms"
data=df_usa)
ax0.set_title("Better understaning price", fontsize=15)
ax0.set_xlabel("Sqft Living")
ax0.set_ylabel("log Price(US)")
ax0.set_xticklabels(ax0.get_xticklabels(),rotation=90)
plt.show()
我需要这样的输出: output of cod with using ax.plot...
请记住,我需要使用seaborn。