본문 바로가기
ML , DL/Matplotlib

matplotlib의 plot에서 s, c, cmap 매개변수

by 바다가좋아서 2021. 10. 19.

**코드**

housing.plot(kind='scatter', x='longitude', y='latitude', alpha=0.4,

s=housing['population']/100, label='population', figsize=(10,7),

c='median_house_value', cmap=plt.get_cmap('jet'), colorbar=True,

sharex=False)

# s : 원의 반지름 (구역의 인구)

# c : 색상 (가격)

# cmap : color map 중 파랑(낮은)에서 빨강(높음)까지 범위를 나타내는 'jet'

plt.legend()