Marker size variation
📖 Scenario: You are analyzing sales data for a small store. You want to visualize the sales amounts for different products using a scatter plot. To make the plot more informative, you will vary the size of the markers based on the sales amount.
🎯 Goal: Create a scatter plot where the marker size changes according to the sales amount for each product.
📋 What You'll Learn
Create a dictionary called
sales with product names as keys and sales amounts as values.Create a list called
sizes that contains marker sizes based on the sales amounts.Use
matplotlib.pyplot to create a scatter plot with product names on the x-axis and sales amounts on the y-axis.Set the marker sizes in the scatter plot using the
sizes list.Display the plot.
💡 Why This Matters
🌍 Real World
Visualizing sales data with marker size variation helps quickly identify which products sell more, making it easier to focus on popular items.
💼 Career
Data analysts and scientists often use scatter plots with varying marker sizes to represent additional data dimensions visually.
Progress0 / 4 steps