fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(7.9, 5))
# Scatter plot with regression line for 'Time on Website' vs 'Yearly Amount Spent'
sns.scatterplot(
x='Time on Website', y='Yearly Amount Spent',
data=salesdata, ax=ax1
)
sns.regplot(
x='Time on Website', y='Yearly Amount Spent',
data=salesdata, ax=ax1, scatter=False, color='blue'
)
ax1.set_title('Time on Website vs Yearly Amount Spent')
# Scatter plot with regression line for 'Time on App' vs 'Yearly Amount Spent'
sns.scatterplot(
x='Time on App', y='Yearly Amount Spent',
data=salesdata, ax=ax2
)
sns.regplot(
x='Time on App', y='Yearly Amount Spent',
data=salesdata, ax=ax2, scatter=False, color='blue'
)
ax2.set_title('Time on App vs Yearly Amount Spent')
plt.tight_layout()
plt.show()