matlab 叠加 area,[转载]matlab学习——area填色图

[time,a2,a3,a4,a5,a6,a7,a8,a9]=textread('Application

Traffic Share by Hour.txt','%s%s%s%s%s%s%s%s%s');

%,'headerlines',4去掉头4行

lengendstr={'Data and Browsing' 'Online Video'

'P2P File Sharing' 'Other File Sharing' 'Voice and Video

Communications' 'Data Communications' 'Gaming Consoles' 'PC

Gaming'};

a=[a2,a3,a4,a5,a6,a7,a8,a9];

[row column]=size(a);

data=zeros(24,8);

for i=1:1:row

for j=1:1:column

data(i,j)=str2double(strtok(a(i,j),'%'));

end

end

�ta=data/100;

%颜色选择,最多提供11种颜色选择(依次是红、绿、蓝、紫红、青、紫、橙、棕、灰、黄、黑)

color_a={[1 0 0];[0 1 0];[0 0 1];[1 0 1];[0 1

1];[0.6 0 1];[1 0.5 0];[0.5 0 0];[0.5 0.5 0.5];[1 1 0];[0 0

0]};

marker_b='*d^v>

%colorarray={'r.' 'bo' 'g*' 'm+' 'c-' 'y:'

};

hold on

% for i=1:1:column

%

plot(1:1:24,data(:,i),['-'

marker_b(i)],'color',color_a{i});

% end

h=area(1:1:24,data);

for i=1:1:8

set(h(i),'FaceColor',color_a{i})

set(h(i),'EdgeColor',color_a{i})

end

maxdata=max(max(data));

axis([1 24 0 100])

set(gca,'XTick',1:1:length(time))

set(gca,'XTickLabel',time);

% set(gca,'XTick',1:1:length(time))

ylabelstr=cell(1,11);

for i=1:1:11

ylabelstr{i}=[num2str((i-1)*10) '%'];

end

set(gca,'YTick',0:10:100)

set(gca,'YTickLabel',ylabelstr);

rotateticklabel(gca, 90);

legend(lengendstr,'Location','BestOutside')

%

exportfig(gcf,'classificationMatrixDataPlot.jpg',

'Format','jpeg','height',9.5,'width',25, ...

%

'Color','cmyk','Resolution',300,

'FontMode','Fixed','FontSize',12,'LineMode','Fixed','LineWidth',1);

%生成.jpg图片

exportfig(gcf,'classificationMatrixDataArea.jpg',

'Format','jpeg','height',9.5,'width',25,

'Bounds','loose', ...

'Color','cmyk','Resolution',300,

'FontMode','Fixed','FontSize',12,'LineMode','Fixed','LineWidth',1);

%生成.jpg图片

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值