怎样用matlab画风玫瑰图?恳求

怎样用matlab画风玫瑰图?恳求,第1张

  画静风

  b=fp(1:16);

  a=fp(17);

  po=b;

  m=5;%圈数

  w= ceil(max(po)/m)/100

  dir_ang=(0:225:360)pi/180;

  wn=1/m;

  po=po/w/100wn;

  po(17)=po(1);

  px=(po)sin(dir_ang);

  py=(po)cos(dir_ang);

  ang_cyc=0:001:2pi;

  fori=1:17

  plot([-1-008]cos(dir_ang(i)),[-1 -008]sin(dir_ang(i)),'k');

  holdon

  plot([0081]cos(dir_ang(i)),[008 1]sin(dir_ang(i)),'k');

  holdon

  end

  for i=1:m

  plot((iwn)cos(ang_cyc),(iwn)sin(ang_cyc),'k:')

  %    text((i-04)wn,004,[num2str(iw100),'%']);

  text((i)wn,004,num2str(iw100));

  hold on

  end

  plot(008 cos(ang_cyc),008sin(ang_cyc) ,'k')

  hold on

  plot(px,py,'-','LineWidth',2);

  plot(px,py,'','LineWidth',4);

  text(-004,0,[num2str(a),'%']);

  text((mwn+01)sin(2/180pi),(mwn+01)cos(0/180pi),'N','rotation',180)

  text((mwn+01)sin(175/180pi),(mwn+01)cos(175/180pi),'NNE','rotation',337)

  text((mwn+01)sin(42/180pi),(mwn+01)cos(42/180pi),'NE','rotation',315)

  text((mwn+01)sin(625/180pi),(mwn+01)cos(625/180pi),'ENE','rotation',2925)

  text((mwn+01)sin(88/180pi),(mwn-08)cos(88/180pi),'E','rotation',0)

  text((mwn+005)sin(1085/180pi),(mwn+06)cos(1085/180pi),'ESE','rotation',675)

  text((mwn)sin(132/180pi),(mwn+025)cos(132/180pi),'SE','rotation',45)

  text((mwn-025)sin(1525/180pi),(mwn+02)cos(1525/180pi),'SSE','rotation',225)

  text((mwn+01)sin(178/180pi),(mwn+01)cos(178/180pi),'S','rotation',180)

  text((mwn+09)sin(1955/180pi),(mwn+003)cos(1955/180pi),'SSW','rotation',-225)

  text((mwn+03)sin(220/180pi),(mwn)cos(220/180pi),'SW','rotation',-45)

  text((mwn+02)sin(2415/180pi),(mwn-03)cos(2415/180pi),'WSW','rotation',-675)

  text((mwn+015)sin(268/180pi),(mwn-08)cos(268/180pi),'W','rotation',0)

  text((mwn+01)sin(2865/180pi),(mwn+01)cos(2865/180pi),'WNW','rotation',675)

  text((mwn+01)sin(312/180pi),(mwn+01)cos(312/180pi),'NW','rotation',45)

  text((mwn+01)sin(3315/180pi),(mwn+01)cos(3315/180pi),'NNW','rotation',225)

  axis off

  axis equal

 

  不画静风

  po=b;

  m=5;%圈数

  w= ceil(max(po)/m)/100

  dir_ang=(0:225:360)pi/180;

  wn=1/m;

  po=po/w/100wn;

  po(17)=po(1);

  px=(po)sin(dir_ang);

  py=(po)cos(dir_ang);

  ang_cyc=0:001:2pi;

  fori=1:17

  plot([-11]cos(dir_ang(i)),[-1 1]sin(dir_ang(i)),'k');

  holdon

  end

  for i=1:m

  plot((iwn)cos(ang_cyc),(iwn)sin(ang_cyc),'k:')

  %    text((i-04)wn,004,[num2str(iw100),'%']);

  text((i)wn,004,num2str(iw100));

  hold on

  end

  plot(px,py,'-','LineWidth',2);

  plot(px,py,'','LineWidth',4);

  text((mwn+01)sin(2/180pi),(mwn+01)cos(0/180pi),'N','rotation',180)

  text((mwn+01)sin(175/180pi),(mwn+01)cos(175/180pi),'NNE','rotation',337)

  text((mwn+01)sin(42/180pi),(mwn+01)cos(42/180pi),'NE','rotation',315)

  text((mwn+01)sin(625/180pi),(mwn+01)cos(625/180pi),'ENE','rotation',2925)

  text((mwn+01)sin(88/180pi),(mwn-08)cos(88/180pi),'E','rotation',0)

  text((mwn+005)sin(1085/180pi),(mwn+06)cos(1085/180pi),'ESE','rotation',675)

  text((mwn)sin(132/180pi),(mwn+025)cos(132/180pi),'SE','rotation',45)

  text((mwn-025)sin(1525/180pi),(mwn+02)cos(1525/180pi),'SSE','rotation',225)

  text((mwn+01)sin(178/180pi),(mwn+01)cos(178/180pi),'S','rotation',180)

  text((mwn+09)sin(1955/180pi),(mwn+003)cos(1955/180pi),'SSW','rotation',-225)

  text((mwn+03)sin(220/180pi),(mwn)cos(220/180pi),'SW','rotation',-45)

  text((mwn+02)sin(2415/180pi),(mwn-03)cos(2415/180pi),'WSW','rotation',-675)

  text((mwn+015)sin(268/180pi),(mwn-08)cos(268/180pi),'W','rotation',0)

  text((mwn+01)sin(2865/180pi),(mwn+01)cos(2865/180pi),'WNW','rotation',675)

  text((mwn+01)sin(312/180pi),(mwn+01)cos(312/180pi),'NW','rotation',45)

  text((mwn+01)sin(3315/180pi),(mwn+01)cos(3315/180pi),'NNW','rotation',225)

  axis off

  axis equal

  我以前自己编的代码,其中b为16个风向频率,a为静风频率。

  这个不好复制,给个邮箱,我发你份

效果图见下

 



欢迎分享,转载请注明来源:品搜搜测评网

原文地址:https://pinsoso.cn/meirong/1649571.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-10-07
下一篇2023-10-07

随机推荐

发表评论

登录后才能评论
保存