FunctionRacerProblemsRace

Biggest First, With a Running Share

HardmatplotlibPython

A Pareto chart shows which few causes make up most of a total. Sort the names by value from largest to smallest (the values are all different). Draw a bar chart of the sorted values by name. Then add a second y axis on the right sharing the x axis, and on it draw a line through the positions 0, 1, 2, ... with the running share of the total in percent: after the first bar, after the first two, and so on up to 100. Return the figure.

Checked: the bars, the x tick labels and the lines.

Example 1

names ["late","broken","wrong","other"]
values [10,60,25,5]
draws
The chart to draw in example 1 of Biggest First, With a Running Share

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