Bars on Top of Bars
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

Constraints
1 <= len(names) <= 8, all different- The amounts are 0 or more
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More matplotlib problems
- Boxes for GroupsMedium
- Grid of FourMedium
- Numbers on a HeatmapMedium
- Price and Its AverageMedium
- Shade the RangeMedium
- Two ScalesMedium
- Two Spreads, Same BinsMedium
- Bell Over the BarsHard