Matlab: ring graphs

Is there an easy way in Matlab to create visualizations as shown below?

Visualization

Important are two ring-shaped shapes and attached vectors (more or less) indicating the center of the black spots. Tips for other visualization tools that create vector images that can produce similar results are also greatly appreciated! All my efforts to solve this problem did not lead me further ...

Matlab will be a good platform for automatically creating this kind of visualization for different "spot scenarios" ...

Thanks in advance, M.

+4
source share
2 answers

Here is part of the picture. The rest should be easy to figure out.

%# 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) 

enter image description here

+2
source

All Articles