%
% pareto charts
%
label = 'ABCDEF';
freq = [ 31 226 22 12 1 5 ];
cost = [ 1375 6000 15660 5200 16500 26500 ];
%
figure;
n = length(freq);
[ y, i ] = sort( freq );
i = i(n:-1:1);
bar(freq(i));
%
set( gca, 'fontsize', 24 );
xlabel( 'Problems' );
ylabel( 'Frequency per year' );
for j = 1:n,
  h = text( j-0.13, freq(i(j))+10, label(i(j)) );
  set( h, 'fontsize', 24 );
end;
%
print -f1 -deps2 pareto1.eps
%
figure;
n = length(cost);
[ y, i ] = sort( cost/1000 );
i = i(n:-1:1);
bar(cost(i)/1000);
%
set( gca, 'fontsize', 24 );
xlabel( 'Problems' );
ylabel( 'Net cost in $''000' );
for j = 1:n,
  h = text( j-0.13, cost(i(j))/1000+1, label(i(j)) );
  set( h, 'fontsize', 24 );
end;
%
print -f2 -deps2 pareto2.eps
%
