資源簡介
matlab中畫餅圖命令、條形圖命令、柱狀圖命令、及標(biāo)注。橫縱坐標(biāo)顯示
代碼片段和文件信息
%%?question?1?What?is?the?proportion?of?your?network?consumption?to?monthly?consumption?in?the?past?year??
data?=?[17?23?12?5];
label?=?{‘Less?than?20%‘??‘20%-50%‘?‘50%-80%‘?‘More?than?80%‘};
explode=[0?0?1?1];%定義突出的部分
bili=data/sum(data);%計(jì)算比例
baifenbi=num2str(bili‘*100‘%1.2f‘);%計(jì)算百分比
baifenbi=[repmat(blanks(2)length(data)1)baifenbirepmat(‘%‘length(data)1)];
baifenbi=cellstr(baifenbi);
Label=strcat(labelbaifenbi‘);
pie(dataexplodeLabel)
%%?question?2?What?is?your?concept?of?consumption??
figure;
data?=?[8?42?6?1];
label?=?{‘save?every?penny?at?the?moment‘?‘consumption?in?a?planned?way‘?‘don‘‘?t?care?spend?randomly‘?‘others‘};
explode=[0?0?1?0];%定義突出的部分
bili=data/sum(data);%計(jì)算比例
baifenbi=num2str(bili‘*100‘%1.2f‘);%計(jì)算百分比
baifenbi=[repmat(blanks(2)length(data)
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????1721575??2018-04-09?16:50??1.tif
?????文件?????1721575??2018-04-09?17:05??2.tif
?????文件??????606845??2018-04-09?19:09??3.tif
?????文件??????348371??2018-04-09?19:19??4.tif
?????文件??????662411??2018-04-09?19:08??5.tif
?????文件????????2156??2018-04-09?19:14??dataPlot.m
評論
共有 條評論