IniziaInizia gratis

Heat map alternatives

There are several alternatives to heat maps. The best choice really depends on the data and the story you want to tell with this data. If there is a time component, the most obvious choice is a line plot.

Questo esercizio fa parte del corso

Intermediate Data Visualization with ggplot2

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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)
Modifica ed esegui il codice