시작하기무료로 시작하기

히트맵의 대안

히트맵에는 여러 대안이 있어요. 최선의 선택은 데이터와 그 데이터로 전달하려는 이야기의 성격에 달려 있습니다. 시간 요소가 있다면, 가장 분명한 선택은 선 그래프(line plot)입니다.

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

ggplot2로 하는 중급 데이터 시각화

강의 보기

실습형 인터랙티브 연습

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

# The heat map we want to replace
# Don't remove, it's here to help you!
ggplot(barley, aes(x = year, y = variety, fill = yield)) +
  geom_tile() +
  facet_wrap( ~ site, ncol = 1) +
  scale_fill_gradientn(colors = brewer.pal(9, "Reds"))

# Using barley, plot yield vs. year, colored and grouped by variety
___ +
  # Add a line layer
  ___ +
  # Facet, wrapping by site, with 1 row
  facet_wrap( ~ site, nrow = 1)
코드 편집 및 실행