FunctionRacerProblemsRace

Bars on Top of Bars

MediummatplotlibPython

Each name has two amounts, first[i] and second[i]. Draw a stacked bar chart: for every name, a bar for the first amount standing on 0, and a bar for the second amount standing on top of it. Return the figure.

Checked: the bars and the x tick labels.

Example 1

names ["tea","milk","jam"]
first [3,5,2]
second [4,4,1]
draws
The chart to draw in example 1 of Bars on Top of Bars

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More matplotlib problems