Draw multiple circles as a single line object

バージョン (2.49 KB) 作成者: Brett Shoelson
FAST, EFFICIENT drawing of multiple circles!

ダウンロード 973 件

更新 2016/9/1


Plot multiple circles as a single line object...very fast, very efficient!

circles(radii,centers) plots circles of radius values specified by RADII, at centers specified by CENTERS.
Will accept as inputs any valid properties accepted by PLOT, and return the handle to the line object as well as a vector of plotted xs and ys (delimeted by NaNs for individual circles).


r = rand(20,1)*100;
c = rand(20,2)*300;
[h,xs,ys] = circles(r,c,...
axis equal

Note that if r is a scalar and c is a single x-y- coordinate, this works just like other approaches to circle plotting. But with multiple radii and centers, using CIRCLES provide FAST, memory-efficient plotting (with the trade-off that only a single handle is returned).


Brett Shoelson (2022). Draw multiple circles as a single line object (https://www.mathworks.com/matlabcentral/fileexchange/36954-draw-multiple-circles-as-a-single-line-object), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2012a
Windows macOS Linux
タグ タグの追加

Community Treasure Hunt

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

Start Hunting!