matlab 环形填充颜色,Matlab:环状图

这是图中的一部分.其余的应该很容易理解

%# define the ring

phi = linspace(0,2*pi,360);

innerRim = [cos(phi)',sin(phi)'];

outerRim = [cos(phi)',sin(phi)']*1.3;

xRing = [outerRim(:,1),innerRim(:,1),innerRim([2:end,1],1),outerRim([2:end,1],1)]';

yRing = [outerRim(:,2),innerRim(:,2),innerRim([2:end,1],2),outerRim([2:end,2],2)]';

%# create some data. 0 for black 0.5 for gray.

%# RingData has a value for each degree

ringData = ones(1,360) * 0.5;

ringData(25:30) = 0;

ringData(77:80) = 0;

ringData(240:255) = 0;

%# plot the ring

%# for an outer ring, add 1 to xRing, yRing

figure

patch(xRing,yRing,ringData,'EdgeColor','none');

set(gca,'cLim',[0 1]);

axis square

axis off

set(gcf,'color','w');

%# plot three arrows at the origin

hold on, qh=quiver(zeros(3,1),zeros(3,1),[0.4;0.3;-0.5],[0.7;-0.1;0.3])

set(qh,'LineWidth',3)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值