Hi there. My aim is to plot multiple concentric circles at different locations on a picture. The following coding was used to accomplish it. My problem is I want to label each circle with a value on the legend. So each circle will have different colour and the legend will show the value. It would be better if i could label it on the cirlce itself. I tried to do it with the legend command, but it didn't work. Can anyone help me out? Thank you.
The coding are as follows:
I = imread('aaaa.png') ;
figure(1)
imshow(I)
th = linspace(0,2*pi) ;
hold all
while true
hold all
message = sprintf('Click where you want the center to be');
uiwait(helpdlg(message));
[xCenter, yCenter] = ginput(1);
X=[5,30,100];
for radius =(X)
x = radius * cos(th) + xCenter;
y = radius * sin(th) + yCenter;
plot(x, y, '-');
title('Risk Contour')
end
legend(input('array form'),'AutoUpdate','off')
hold all
j = input(' Stop and proceed? (input: "y" - yes (stop) or "n" - no (if want to plot another contour))\n','s');
if j=='n'
continue
elseif j=='y'
break
else
disp('Error:Input should be ''y'' or ''n''\n')
end
end