| MATLAB Function Reference | ![]() |
![]()
To graph selected variables, use the Plot Selector
in the Workspace Browser,
or use the Figure Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor. For details,
see Plotting Tools
— Interactive Plotting in the MATLAB® Graphics
documentation and Creating Graphics
from the Workspace Browser in the MATLAB Desktop Tools
documentation.
pareto(Y)
pareto(Y,names)
pareto(Y,X)
H = pareto(...)
Pareto charts display the values in the vector Y as bars drawn in descending order. Values in Y must be nonnegative and not include NaNs. Only the first 95% of the cumulative distribution is displayed.
pareto(Y) labels each bar with its element index in Y and also plots a line displaying the cumulative sum of Y.
pareto(Y,names) labels each bar with the associated name in the string matrix or cell array names.
pareto(Y,X) labels each bar with the associated value from X.
pareto(ax,..) plots a Pareto chart in existing axes ax rather than GCA.
H = pareto(...) returns a combination of patch and line object handles.
Example 1:
Examine the cumulative productivity of a group of programmers to see how normal its distribution is:
codelines = [200 120 555 608 1024 101 57 687];
coders =
{'Fred','Ginger','Norman','Max','Julia','Wally','Heidi','Pat'};
pareto(codelines, coders)
title('Lines of Code by Programmer')

Example 2:
Generate a vector, X, representing diagnostic codes with values from 1 to 10 indicating various faults on devices emerging from a production line:
X = min(round(abs(randn(100,1)*4))+1,10);
Plot a Pareto chart showing the frequency of failure for each diagnostic code from the most to the least common:
pareto(hist(X))

You can use pareto to display the output of hist, even for vectors that include negative numbers. Because only the first 95 percent of values are displayed, one or more of the smallest bars may not appear. If you extend the Xlim of your chart, you can display all the values, but the new bars will not be labeled.
![]() | pan | parfor | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |