📅  最后修改于: 2021-01-07 02:40:32             🧑  作者: Mango
此函数创建一个饼图。此函数确定与x的每个值相对应的总饼图的百分比,并绘制该大小的饼图。
可选的数组爆炸控制单个饼图是否与饼图的其余部分分开。
pie(x) // It draws a pie chart with the data in x.
pie(x, explode) // It offsets a slice from the pie.explode is a vector or matrix of zeroes and non-zeroes corresponding to x.
World population by continents.
cont= char('Asia','Europe','Africa',....'N.America','S.America');
pop=[3332;696;694;437;307];
pie(pop)
for i=1:5,
gtext (cont(i,:));
end
Title ('World Population (1992)',....'fontsize', 18)
输出: