Last active
January 2, 2017 04:46
-
-
Save AlexJF12/1e2ee3dcf6ed4cab6b3c7462153f4d46 to your computer and use it in GitHub Desktop.
DC Bike Day Heatmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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