Plot circle in meters
Show older comments
Hi,
I'm trying to plot several circles 5 meters in size within a room represented by the gird
pos = [0 0 5 5];
pos2 = [10 10 5 5];
pos3 = [20 20 5 5];
pos4 = [30 30 5 5];
rectangle('Position',pos,'Curvature',[1 1])
rectangle('Position',pos2,'Curvature',[1 1])
rectangle('Position',pos3,'Curvature',[1 1])
rectangle('Position',pos4,'Curvature',[1 1])
axis equal
axis([0 100 0 100])
I'm using the axis to represent the room size so in this case 100 meters by 100 meters. Sometimes the room size might vary say double so 200x200 and the graph then scales and everything gets smaller.
What I was hoping is everything stayed the same size but the graph grew its size rather than scale it down the fit within the small graph size
Is this possible
Thanks
Answers (1)
Brandon
on 13 Mar 2015
Try something like this:
figure();
AX(1) = axes;
axis equal
hold('on');
set(AX(1), 'XLim', [0 100], 'YLim', [0 100]);
XC = 2.5*sin(linspace(0,2*pi,100)); YC = 2.5*cos(linspace(0,2*pi,100));
h(1) = fill(XC + 50, YC + 50, 'r'); % create circle
Categories
Find more on Title in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!