Created
December 6, 2023 17:46
-
-
Save Priyanku-AI/5ca68627e66f395ccdbaecf2bd634ae2 to your computer and use it in GitHub Desktop.
How to create a Box plot?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
import matplotlib.pyplot as plt | |
# Example Data (randomly generated) | |
data = sns.load_dataset("tips") | |
# Creating the Box Plot | |
sns.boxplot(x="day", y="total_bill", data=data, palette="Set2") | |
# Create a box plot of total bill amounts grouped by day, using the 'Set2' color palette | |
# Adding Labels | |
plt.title('Box Plot of Total Bills by Day') | |
plt.xlabel('Day') | |
plt.ylabel('Total Bill Amount') | |
# Displaying the Plot | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment