I want to change xlim,ylim of axes , and draw a circle at the point I chose when I click on a place in the axes in GUI
1 view (last 30 days)
Show older comments
0 Comments
Accepted Answer
KSSV
on 25 Oct 2021
th = linspace(0,2*pi) ;
R = 1. ; % Radius of circle
x = R*cos(th) ; y = R*sin(th) ;
figure
axis([-5 5 -5 5]) ; % cahange axes here to your desired
[Cx,Cy] = getpts() ; % click where you want to draw circle; double click to exit
hold on
% plot the circles
for i = 1:length(Cx)
plot(Cx(i)+x,Cy(i)+y)
end
axis equal
0 Comments
More Answers (0)
See Also
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!