How to make a grid of dots?
16 views (last 30 days)
I have a function to plot a circle:
function circle = circleplot(x,y,r,c)
th = 0:pi/50:2*pi;
x_circle = r * cos(th) + x;
y_circle = r * sin(th) + y;
circle = plot(x_circle, y_circle);
fill(x_circle, y_circle, c);
plot(x, y, 'p', 'MarkerSize',15, 'MarkerFaceColor','r');
I'd like to use this function to make a grid of dots that have circles with a radius of 1. Also, I want to have a certain amount of spacing between the center of each circle. Would I need to alter my function in any way or do I do all of this with inputs alone? Greatly appreciate any help/advice!