MATLAB Answers

How to draw a circle in a log-log plot?

29 views (last 30 days)
Eneru Y
Eneru Y on 16 Jan 2016
Commented: Adam Danz on 24 May 2019
Hello guys, I need to make a graph that shows two concentric circles of very different sizes. I need to draw a concentric circles in a log-log plot. How can I do?

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 16 Jan 2016
Use the FAQ to draw a circle, then exponentiate:
xCenter = 12;
yCenter = 10;
theta = 0 : 0.01 : 2*pi;
radius = 5;
x = radius * cos(theta) + xCenter;
y = radius * sin(theta) + yCenter;
xe = exp(x);
ye = exp(y);
loglog(xe, ye, 'LineWidth', 2);
axis square;
grid on;
hold on;
% Draw second circle
radius = 3;
x = radius * cos(theta) + xCenter;
y = radius * sin(theta) + yCenter;
xe = exp(x);
ye = exp(y);
loglog(xe, ye, 'LineWidth', 2);

  2 Comments

Adam Danz
Adam Danz on 24 May 2019
Any idea how to keep the transformed circles centered at the (xCenter, yCenter) coordinates?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!