circle in pcolor map with radius as half of map length

조회 수: 3 (최근 30일)
Bhowmik.U
Bhowmik.U 2019년 4월 5일
댓글: Walter Roberson 2021년 1월 6일
Hello, I want to plot pcolor
pcolor(X)
X=50 * 50 matrix
I wish to plot a circle within pcolor map; with centre as centre of circle; and radius as half of pcolor map.
I hope I am clear. Please help.
  댓글 수: 5
Star Strider
Star Strider 2019년 4월 8일
I am not certain what result you want.
If you define your pcolor plot in terms of a radius and an angle (rather than x and y), you can then use the pol2cart function to create a circle plot from it. For an example, see Applying shading radially outwards on a circle (link).
Bhowmik.U
Bhowmik.U 2019년 4월 9일
I am enclosing the diagrammatic representation of my querry....I wish to eliminate the gray part from pcolor plot.

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

답변 (1개)

Walter Roberson
Walter Roberson 2019년 4월 9일
편집: Walter Roberson 2019년 4월 9일
temp = -24.5:1:24.5;
mask = temp.^2 .' + temp.^2 > 24.5.^2;
Xt = X;
Xt(mask) = nan;
pcolor(Xt);
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 1월 6일
temp = -24.5:1:24.5;
mask = temp.^2 .' + temp.^2 <= 24.5.^2;
pcolor(X)
hold on
pcolor(mask)

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by