Detect Misleading Chart Configurations
Advanced · Write the code · from Data Visualization: Choose the Right Chart and Tell a Story
From the lesson: Data Visualization: Choose the Right Chart and Tell a Story
A chart that looks pretty but tells the wrong story is worse than no chart at all. In 1986, NASA engineers showed managers a chart arguing that cold temperatures could damage the Space Shuttle Challenger's O-ring seals. The chart was so poorly designed that the managers couldn't see the pattern.
Read the lessonWrite a function find_issues(config) that takes a dictionary with chart configuration and returns a list of issue strings. Check for these problems: (1) If y_min is not 0 and chart_type is 'bar', add 'truncated axis'. (2) If categories > 6 and chart_type is 'pie', add 'too many pie slices'. (3) If is_3d is True, add 'unnecessary 3d'. (4) If has_title is False, add 'missing title'. Print the sorted issues for the test config.
More Data Visualization exercises
- Choose the Right Chart TypeAdvanced
- Build Accessible Chart ConfigurationsAdvanced
- Calculate the Deception FactorAdvanced
- Build a Data Story with Key EventsAdvanced
All Python exercises · 50 practice problems · Data Science & Machine Learning quiz