#remotes::install_github("tylermorganwall/rayshader") require(tidyverse) require(rayshader) require(scales) weather <- read_csv('betta_weatha.csv') %>% pivot_longer(temp:cloud_cover, names_to="cat", values_to="value") %>% group_by(cat) %>% mutate( adj_value = ((value - min(value))/(max(value) - min(value))) + 0.2, time = as.POSIXct(time) ) %>% filter(cat != 'cloud_cover') weather$cat <- factor(weather$cat, levels = c("temp", "humidity", "wind")) twoD <- ggplot(weather, aes(x = time, y = 1, fill = adj_value)) + geom_tile(color = '#000000') + scale_fill_continuous(low='#cccccc', high = '#cccccc') + theme_minimal() + theme( legend.position = 'none', panel.grid = element_blank(), axis.text.y=element_blank() ) + xlab('') + ylab('') + scale_x_datetime(breaks=date_breaks("1 hour"), labels=date_format("%I%p"), expand = c(0, 0)) + facet_wrap(~cat, ncol = 1, strip.position = "left") plot_gg(twoD, multicore = TRUE, width = 6, height = 2, scale = 300, background = "#afceff",shadowcolor = "#3a4f70") render_camera(theta=-20,phi=65)