How can I add a circle to this..
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
KSSV
2015 年 11 月 13 日
Let the center of circle be (a,b) and radius be 'r'. Use parametric equations of circle.
x = a+r*cos(theta) ; y = b+r*sin(theta) ;
You have to define theta into a array.
use hold on ;
plot(x,y,'r') ;
this will plot circle on the given plot.
その他の回答 (1 件)
Image Analyst
2015 年 11 月 13 日
Or alternatively you could use rectangle() (believe it or not, see the help), or
plot(x,y,'MarkerSize', 100).
3 件のコメント
Image Analyst
2015 年 11 月 13 日
It looks like you accepted the Answer from the FAQ. But if you just want to put a circle on a graph, you can do it much simpler with rectangle or plot. Just experiment with different MarkerSizes to get the size you want. Typically if you don't specify it, I think it's something like 8 or so. But if you want larger, use bigger numbers. I just guessed at 100 but you could try 20 or 50 or whatever. It's probably faster because you're not plotting an array of a bunch of points like if you use a parameterized circle.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
