시작하기무료로 시작하기

컬러맵

영역들을 구분하되, 영역 간의 어떤 관계도 암시하고 싶지 않을 때는 정성적(qualitative) 컬러맵이 가장 좋습니다. 이 연습 문제에서는 school_districts GeoDataFrame(변수 school_districts로 제공됨)을 사용해 정성적 컬러맵과 연속형(정량적) 컬러맵을 비교해 보겠습니다.

이 연습은 강의의 일부입니다

Python으로 지리공간 데이터 시각화하기

강의 보기

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Set legend style
lgnd_kwds = {'title': 'School Districts',
               'loc': 'upper left', 'bbox_to_anchor': (1, 1.03), 'ncol': 1}

# Plot the school districts using the tab20 colormap (qualitative)
school_districts.plot(column = ____, ____ = 'tab20', ____ = True, ____ = lgnd_kwds)
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.title('Nashville School Districts')
plt.show();
코드 편집 및 실행