Main Content

극좌표에 플로팅하기

이 예제에서는 극좌표에 선 플롯, 산점도 플롯, 히스토그램을 생성하는 방법을 보여줍니다. 또한 극좌표 플롯의 좌표축 제한을 변경하고 주석을 지정하는 방법도 보여줍니다.

극좌표 선 플롯 생성하기

극좌표에 안테나의 방사 패턴을 시각화합니다. 변수 thetarho가 포함되어 있는 파일 antennaData.mat를 불러오겠습니다. 변수 rho는 각 theta 값에 대한 안테나의 방사 강도를 측정한 값입니다. polarplot 함수를 사용하여 극좌표에 데이터를 플로팅하여 이 방사 패턴을 시각화해 보겠습니다.

load('antennaData.mat')

figure
polarplot(theta,rho)

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type line.

R2022a 이전의 릴리스에서는 극좌표 좌표축이 도 기호를 기본적으로 포함하지 않습니다. 추가하려면 pax = gca를 사용하여 극좌표 좌표축을 가져오십시오. 그런 다음 pax.ThetaTickLabel = string(pax.ThetaTickLabel) + char(176)을 사용하여 눈금 레이블을 수정하십시오.

여러 개의 극좌표 선 플롯

hold on을 사용하여 현재 극좌표 좌표축을 유지하고, polarplot을 사용하여 데이터를 추가로 플로팅합니다.

rng('default')
noisy = rho + rand(size(rho)); 
hold on
polarplot(theta,noisy)
hold off

Figure contains an axes object with type polaraxes. The polaraxes object contains 2 objects of type line.

극좌표 플롯에 주석 달기

legendtitle 등의 주석 함수를 사용하여, 다른 시각화 유형처럼 극좌표 플롯에 레이블을 지정할 수 있습니다.

legend('Original','With Noise')
title('Antenna Radiation Pattern')

Figure contains an axes object with type polaraxes. The polaraxes object contains 2 objects of type line. These objects represent Original, With Noise.

극좌표 좌표축 제한 변경하기

기본적으로, 음수 반지름 값은 극좌표 플롯에 양수 값으로 플로팅됩니다. rlim을 사용하여 음수 값을 포함하도록 r축 제한을 조정해 보겠습니다.

rmin = min(rho);
rmax = max(rho);
rlim([rmin rmax])

Figure contains an axes object with type polaraxes. The polaraxes object contains 2 objects of type line. These objects represent Original, With Noise.

thetalim을 사용하여 세타축 제한을 0과 180으로 변경합니다.

thetalim([0 180])

Figure contains an axes object with type polaraxes. The polaraxes object contains 2 objects of type line. These objects represent Original, With Noise.

극좌표 산점도 플롯 생성하기

극좌표에 풍속 데이터를 플로팅합니다. 변수 direction, speed, humidity, C가 포함되어 있는 파일 windData.mat를 불러오겠습니다. polarscatter 함수를 사용하여 극좌표에 데이터를 플로팅하여 풍속 패턴을 시각화해 보겠습니다.

load('windData.mat')
polarscatter(direction,speed)

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type scatter.

세 번째 데이터 입력값을 포함해 다양한 마커 크기를 지정하고 세 번째 차원을 나타냅니다.

polarscatter(direction,speed,humidity)

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type scatter.

형식 지정 입력값을 사용하여 마커 표시 속성을 조정합니다.

polarscatter(direction,speed,humidity,C,'filled')

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type scatter.

극좌표 히스토그램 플롯 생성하기

풍배도로 알려진 시각적 표현을 만드는 polarhistogram 함수를 사용하여 데이터를 시각화합니다.

polarhistogram(direction)

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type histogram. This object represents direction.

Bin 결정 알고리즘을 지정합니다. polarhistogram 함수의 경우, BinMethod 필드 내에 선택할 수 있는 다양한 Bin 번호와 Bin 너비 결정 알고리즘이 있습니다.

polarhistogram(direction,'BinMethod','sqrt')

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type histogram. This object represents direction.

Bin 개수와 Bin 너비를 지정합니다.

polarhistogram(direction,24,'BinWidth',.5)

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type histogram. This object represents direction.

정규화 방법을 지정하고 디스플레이 스타일을 조정하여 채우기를 제외시킵니다.

polarhistogram(direction,'Normalization','pdf','DisplayStyle','stairs')

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type histogram. This object represents direction.

참고 항목

| | | | |