How to create a circle with segments of specific colors

조회 수: 2 (최근 30일)
Ole
Ole 2019년 3월 3일
편집: Image Analyst 2019년 3월 3일
I am trying to create an image of a circle with inner and outer radius, that is divided radially in segments. Then I would like to fill the segments with four solid colors (r b y m) that will repeat around the segments with theta. Ideally each different collor segment will subtend different angle.
rInner = 180; % inner radius of the colour ring
rOuter = 200; % outer radius of the colour ring
ncols = 20; % number of colour segments
[x, y] = meshgrid(-rOuter:1:rOuter);
[theta, rho] = cart2pol(x, y);
Here is an example the circle, it should close but it was bad choice of the angles.
test-01.jpg
  댓글 수: 2
Rik
Rik 2019년 3월 3일
Can you make a small example in paint of what you mean?
Image Analyst
Image Analyst 2019년 3월 3일
편집: Image Analyst 2019년 3월 3일
And you can't adapt my answer below to do that?

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2019년 3월 3일
See attached demo and adapt as needed.
0000 Screenshot.png

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by