查看单个帖子
旧 2010-01-29, 05:02   #1
xiaoyaoxianshi
初级会员
 
注册日期: 2008-05-29
年龄: 43
帖子: 4
声望力: 0
xiaoyaoxianshi 正向着好的方向发展
默认 How to create a relative frequency histogram by rose function

我找了个程序,用rose function 做relative frequency circular histogram. 但是,在这个程序基础上,我还想把满足一定relative frequency的bin填上颜色。如果能根据不同relative frequency填上不同的颜色,就更好了。但是,写了个程序,只能把颜色全部填满,不能根据relative frequency的不同来填充颜色。需要高人指点。谢谢啦!

theta = 2*pi*rand(1,50);
nbins = 30;
[tout,rout] = rose(beta,nbins);
relativefreq = rout/length(beta);
figure(3)
polar(tout,relativefreq);
[xout,yout]=pol2cart(tout, relativefreq);
set(gca,'nextplot','add');
fill(xout,yout,'g')
xiaoyaoxianshi 当前离线   回复时引用此帖