MATLAB Answers

## how can i plot multiple circles in a plot

Asked by Borison ningthoujam

### Borison ningthoujam (view profile)

on 12 Jun 2018
Latest activity Answered by Anton Semechko

### Anton Semechko (view profile)

on 12 Jun 2018
i tried using the code below but they all draw ellipse i want perfect circle not ellipse type
if true
s=[7,7];
d=[0,-4];
c=[5,5];
ox = -10 + (20)*rand(10,1);
oy = -10 + (20)*rand(10,1);
hold on
for l=1:length(ox)
viscircles( [ox(l), oy(l)], 1,'LineStyle','-','LineWidth',1);
end
end

#### 0 Comments

Sign in to comment.

## 1 Answer

Answer by Anton Semechko

### Anton Semechko (view profile)

on 12 Jun 2018

After you finished plotting, use command
axis equal
to make aspect ratios of vertical and horizontal axes equal to one another.
So your code would be
s=[7,7];
d=[0,-4];
c=[5,5];
ox = -10 + (20)*rand(10,1);
oy = -10 + (20)*rand(10,1);
hold on
for l=1:length(ox)
viscircles( [ox(l), oy(l)], 1,'LineStyle','-','LineWidth',1);
end
axis equal

#### 0 Comments

Sign in to comment.