Skip to content

Instantly share code, notes, and snippets.

@AlexJF12
Last active January 2, 2017 04:46
Show Gist options
  • Select an option

  • Save AlexJF12/1e2ee3dcf6ed4cab6b3c7462153f4d46 to your computer and use it in GitHub Desktop.

Select an option

Save AlexJF12/1e2ee3dcf6ed4cab6b3c7462153f4d46 to your computer and use it in GitHub Desktop.
DC Bike Day Heatmap
library(ggplot2)
ggplot(bike_day_heatmap, aes(x = week, y = days, fill = n)) +
scale_fill_viridis(name="# of Rides", option = "C",
limits = c(0, max(bike_day_heatmap$n))) +
geom_tile(color = "white", size = 0.4) +
scale_x_continuous(expand = c(0, 0), breaks = seq(1, 52, length = 12),
labels = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"))+
theme_minimal() +
theme(legend.position = "bottom") +
labs(title = "DC Bikeshare: Heatmap of Rides taken per Day",
x = "Month", y = "Day of the Week",
subtitle = "July 1, 2015 to June 30, 2016",
caption = "Data from: https://s3.amazonaws.com/capitalbikeshare-data/index.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment