%% Customize Chart Appearance
% Define y as a vector of five numbers, and create a Pareto chart. Specify return arguments so you can customize aspects of the chart and axes.

y = [20 30 10 55 5];
[charts, ax] = pareto(y);

%
% Use the charts array to change the colors of the Bar and the Line objects. The first element in charts is the Bar object, and the second element is the Line object. Change the bar colors to a shade of purple, and change the line color to a shade of green.

charts(1).FaceColor = [0.50  0.37  0.60];
charts(2).Color = [0 0.50 0.10];

%
% Next, change the color of the left y-axis to match the bars, and change the color of the right y-axis to match the line. The Axes object for the left side is the first element of the ax array. The other Axes object is in the second element of the ax array.
% After changing the colors, display the axes grid lines.

ax(1).YColor = [0.50 0.37 0.60];
ax(2).YColor = [0 0.50 0.10];
grid on

% Copyright 2020 The MathWorks, Inc.