gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
write a scatter plot using seaborn
- User
write a scatter plot using seaborn
- Assistant
Certainly! Here's an example of how to create a scatter plot using Seaborn in Python:
pythonimport seaborn as sns import matplotlib.pyplot as plt # Load example dataset tips = sns.load_dataset('tips') # Create a scatter plot sns.scatterplot(data=tips, x='total_bill', y='tip', hue='time') # Add title and labels plt.title('Scatter Plot of Total Bill vs Tip') plt.xlabel('Total Bill') plt.ylabel('Tip') # Show the plot plt.show()This code uses the built-in "tips" dataset, plots
total_billon the x-axis andtipon the y-axis, and colors the points based on the time of day (LunchorDinner).