question 438 Visualization & EDA · medium
Review a bar chart before it is published
A reporting team checks every bar chart before publishing. Write chart_problems(fig): inspect the first Axes of the Figure and return a list of the problems found, in this order: "no title" (empty title), "no y label" (empty y label), "bars not sorted" (heights not from largest to smallest), "y axis does not start at 0" (the bottom of the y-axis is above 0). A clean chart gives [].
Function
chart_problems(fig)Reads
ax.get_title(), ax.get_ylabel(), ax.patches heights, ax.get_ylim()Returnsa list of problem texts in the stated order