Plotting two types of graph together
1 view (last 30 days)
Show older comments
Hello
I wonbder if anyone can please help me. I have a scatter plot of co-ordinates and I wish to plot this as a scatter diagram. However I would like to have two circles plotted as well in order to show the inner and outer limits of the co-ordinates. I have managed to create separate plots of these but have not been able to combine them. Does anyone know how this can be achieved?
Please see my example code below:
t = linspace(0,2*pi,1000);
h=-3.3958; %centre
k=58.9725; %centre
r=0.0009; %radius
R=r*2.5; %radius
a=R*cos(t)+h;
b=R*sin(t)+k;
x = r*cos(t)+h;
y = r*sin(t)+k;
scatter(West,North);
plot(a,b,x,y);
axis square;
fill(a,b,'r',x,y,'k');
axis([-3.4,-3.35,58.95,59.0]);
Thank you
0 Comments
Accepted Answer
Friedrich
on 15 Apr 2011
Hi Jennifer,
I could not run you code because West and North are unknown so I replaced it with random values. But I think what your are looking for is:
t = linspace(0,2*pi,1000);
h=-3.3958; %centre
k=58.9725; %centre
r=0.0009; %radius
R=r*2.5; %radius
a=R*cos(t)+h;
b=R*sin(t)+k;
x = r*cos(t)+h;
y = r*sin(t)+k;
hold on
axis square;
axis([-3.4,-3.35,58.95,59.0]);
plot(a,b,x,y);
fill(a,b,'r',x,y,'k');
scatter(rand(100,1)*0.05 - 3.4,rand(100,1)*0.05 + 58.95);
hold off
Friedrich
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!