Skip to content

Instantly share code, notes, and snippets.

@AlexJF12
AlexJF12 / bike time heatmap
Created January 2, 2017 04:48
DC Bike Time Heatmap
library(ggplot2)
ggplot(bike_time_heatmap, aes(x = days, y = start.hour, fill = n)) +
scale_fill_viridis(name="# of Rides", option = "C",
limits = c(0, max(bike_time_heatmap$n))) +
geom_tile(color = "white", size = 0.4) +
theme_minimal() +
scale_y_reverse() +
labs(title = "DC Bikeshare: Heatmap of Rides taken per Hour",
x = "Day of the Week", y = "Starting Hour",
@AlexJF12
AlexJF12 / bike day heatmap.txt
Last active January 2, 2017 04:46
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") +