%% Compare Two Pie Charts
% Create vectors y2010 and y2011, that contain financial data for two years. Then create a cell array containing the labels for the values.

y2010 = [50 0 100 95];
y2011 = [65 22 97 120];
labels = {'Investments','Cash','Operations','Sales'};

%
% Create a 2-by-1 tiled chart layout, and display a pie chart and legend for y2010 data in the first tile. Then display a pie chart and legend for the y2011 data in the second tile.

t = tiledlayout (2,1);
ax1 = nexttile;
pie3(ax1,y2010)
title('2010')
legend(labels)

ax2 = nexttile;
pie3(ax2,y2011)
title('2011')
legend(labels)

%
% Copyright 2019 The MathWorks, Inc.