Box plot with plt.boxplot
📖 Scenario: You are a data analyst working with a small dataset of daily temperatures recorded over a week. You want to visualize the spread and identify any outliers in the temperature data using a box plot.
🎯 Goal: Create a box plot using plt.boxplot to visualize the temperature data.
📋 What You'll Learn
Create a list variable named
temperatures with the exact values: 22, 21, 23, 24, 30, 20, 19Create a variable named
fig and ax by calling plt.subplots()Use
ax.boxplot to create a box plot of the temperatures listSet the title of the plot to exactly
'Daily Temperatures Box Plot'Print the box plot figure object
fig to confirm creation💡 Why This Matters
🌍 Real World
Box plots are used in data science to quickly see the distribution, spread, and outliers of data like temperatures, sales, or test scores.
💼 Career
Data analysts and scientists use box plots to summarize data visually and communicate insights clearly to teams and stakeholders.
Progress0 / 4 steps