资源描述:
《数学建模常用的Matlab绘图总结》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、饼状图Expenses=[201040122019515];ExpenseCategories={'Food','Medical','Lodging','Incidentals',...'Transport','Utilities','Gifts','Shopping'};MostLeastExpensive=(Expenses==max(Expenses)
2、Expenses==min(Expenses));h=pie(gca,Expenses,MostLeastExpensive,ExpenseCategories);Expenses=[201040
3、122019515];MostLeastExpensive=(Expenses==max(Expenses)
4、Expenses==min(Expenses));h=pie(gca,Expenses,MostLeastExpensive);legend('Food','Medical','Lodging','Incidentals',...'Transport','Utilities','Gifts','Shopping');Expenses=[201040122019515];MostLeastExpensive=[01010101];%分割h=pie
5、(gca,Expenses,MostLeastExpensive);legend('Food','Medical','Lodging','Incidentals',...'Transport','Utilities','Gifts','Shopping');x=[201040122019515];explode=[42222422];label={'Food','Medical','Lodging','Incidentals',...'Transport','Utilities','Gifts','Shopping',}';figure('color'
6、,'w','renderer','openGL');h=pie3(x,explode);h=findobj(h,'Type','text');set(h,{'string'},cellfun(@strcat,get(h,{'string'}),label,'un',0),'FontName','TimesNewRoman','FontSize',16);%set(h,{'string'},strcat(get(h,{'string'}),label));%cm=[7265137;14318458;1936049;41121201;...%6065150
7、;1898458;19316090;241121101]/255;colormap(jet),shadinginterpview(18,20),camprojperspectivelight('Position',[123],'Style','inf')lightinggouraudx=[201040122019515];explode=[42222422];label={'14%Food','7%Medical','28%Lodging','9%Incidentals',...'14%Transport','13%Utilities','4%Gift
8、s','11%Shopping',}';figure('color','w','renderer','openGL');pie3s(x,'Explode',explode,'Labels',label)%见Matlab_pie3s直方图Y=round(rand(5,3)*10);figure;subplot(2,2,1);bar(Y,'grouped');title('Group')subplot(2,2,2);bar(Y,'stacked');title('Stack')subplot(2,2,3);bar(Y,'histc');title('His
9、tc')subplot(2,2,4);bar(Y,'hist');title('Hist')stream=RandStream('mrg32k3a','Seed',4);y1=rand(stream,10,5);hb=bar(y1,'stacked');colormap(summer);holdony2=rand(stream,10,1);set(gca,'FontSize',14,'FontName','TimesNewRoman')hp=plot(1:10,y2,'marker','square','markersize',12,...'marke
10、redgecolor','y','markerfacecolor',[.6,0,.6],...