Colorblind-friendly palettes
📖 Scenario: You are working on a data visualization project. You want to make sure your charts are easy to understand for everyone, including people who are colorblind. Using colorblind-friendly palettes helps make your visuals clear and accessible.
🎯 Goal: Create a simple bar chart using a colorblind-friendly palette from matplotlib. You will first set up the data, then choose the palette, apply it to the bars, and finally display the chart.
📋 What You'll Learn
Create a dictionary called
fruits with these exact entries: 'Apples': 10, 'Bananas': 15, 'Cherries': 7, 'Dates': 12Create a variable called
palette and set it to the colorblind-friendly palette 'tab10' from matplotlibUse a
for loop with variables fruit, count to iterate over fruits.items() and plot bars with colors from paletteUse
plt.show() to display the bar chart💡 Why This Matters
🌍 Real World
Colorblind-friendly palettes help make charts readable for people with color vision differences, improving accessibility in reports and presentations.
💼 Career
Data scientists and analysts must create visuals that communicate clearly to all audiences, including those with colorblindness.
Progress0 / 4 steps