Need a slice of pi? 🍕 #PiDay
%% Pizza pie
% Crust & Tomato Sauce
for k=[0.9 0.75; 0.8 0.6; 3 2]
p = piechart([0.85 0.15],'Position',[(1-k(1))/2 (1-k(1))/2 k(1) k(1)]);
p.EdgeColor = 'none';
p.Labels = [];
p.FaceColor = p.ColorOrder(k(3),:);
p.StartAngle = 72;
p.ExplodedWedges = 2;
p.FaceAlpha = k(2);
end
% Pepperonis
origin = 0.46;
pos = get(gcf,'Position');
for k=[8 10;0.16 0.3]
theta=linspace(0,2*pi,k(1));
r1=pos(4)/pos(3)*k(2); % Keep circular
x=r1*cos(theta) + origin;
y=k(2)*sin(theta) + origin;
for i = 1:length(theta)
piechart(1,'Position',[x(i), y(i), 0.08 0.08],'Labels',[],...
'EdgeColor','none','FaceColor',[0.7 0.3 0],'FaceAlpha',0.8);
end
end
✈️
@Persian_IEEEComSoc 📡