I want to fill these 15 equal zones with the different %age value and these values to be depicted by color scale

1 次查看(过去 30 天)
N = 4; % divides to 4 parts
N1 = 10;
a = linspace(0, 2*pi, N*10);
a1 = linspace(0,2*pi, N1*10);
r1 = 100;
r2=58;
r3=25;
x = r1*cos(a1);
y = r1*sin(a1);
x1 = r2*cos(a1);
y1 = r2*sin(a1);
x2 = r3*cos(a);
y2 = r3*sin(a);
figure(1)
plot(x, y,'k')
hold on
plot([x1(1:10:end);x(1:10:end)], [y1(1:10:end);y(1:10:end)])
hold on
x1 = r2*cos(a);
y1 = r2*sin(a);
plot(x1, y1,'r')
plot([x2(1:10:end); x1(1:10:end)], [y2(1:10:end); y1(1:10:end)])
plot(x2, y2,'b')
hold off
axis equal

回答(1 个)

Ayush Bansal
Ayush Bansal 2020-10-29
Use fill(X,Y,C) to fill the polygon having X,Y coordinates, with colour defined by C.
  9 个评论
Ayush Bansal
Ayush Bansal 2020-11-4
Assign the mapped experimental values to the FaceColor property of the polygon object, which will change the polygon color. Additionally change the label of colormap by setting yticklabel using set function.
Use inputdlg(promt) which will create dialogue for user input.
Refer to the attached script.
AASHNA SUNEJA
AASHNA SUNEJA 2020-11-6
Thank you Ayush for the help
This is exactly what I needed but there is just one problem. The figure obtained is not symmetric either all of the zones should be divided by equal distance or there should be no gap between the zones as shown in the figure attached.
I am attaching the figure EXACTLY I need and the one I am getting.
Thanks

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by