%% Create a Pareto Chart
% Define y as a vector of five numbers that sum to 100, so you can see the relationship between the numbers and the bars in the chart.
% Then, create a Pareto chart of y without specifying the x-coordinates. The x-axis tick labels are the locations of the bar values in y. In this case, y(3) is the largest value, so its bar displays in the left most position, followed by y(5) and y(4). These three bars comprise more than 95% of the cumulative distribution, so they are the only bars shown in the chart.

y = [2 3 45 20 32];
pareto(y)

%
% When n of the tallest bars comprise exactly 95% of the cumulative distribution, pareto includes n+1 bars in the chart. For example, define y such that two bars contain exactly 95% of the data. pareto displays the tallest three bars.

y = [4 1 40 55];
pareto(y)

% Copyright 2020 The MathWorks, Inc.