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)
isra sahli
isra sahli on 25 Oct 2021
Edited: isra sahli on 25 Oct 2021

Accepted Answer

KSSV
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

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!