# @file GUIDEA_map.r # @author Martin Brien martin.brien@scotchpartners.com> ################################################################################################### library(pacman) p_load(ggplot2) p_load(scales) p_load(TTR) df = read.csv('sol.csv') df$timestamp = as.POSIXct(df$timestamp,format="%Y-%m-%d %H:%M:%S") # extract Date.Time df$hour = as.numeric(format(df$timestamp, "%H")) # add hour column head(df) ggplot(df,aes(x = timestamp, y = hour, color = G0))+ layer(geom = "point",stat = "identity",position = "identity", # geom_params = list(size=2,bg="black") )+ scale_y_reverse(expand = c(0,0),breaks = c(0:24), labels=c( "0","","","3","","","6","","", "9","","","12","","","15","","", "18","","","21","","","24"), limits = c(24,0))+ scale_x_datetime(breaks = "1 month",expand = c(0,0),labels = date_format("%^b"))+ # scale_color_manual(values = c("Discomfort Hour"="#F1EC17","Comfort Hour"="#FEFEFE")) + theme( panel.background = element_rect(fill = 'white'), # fill background white panel.border = element_rect(fill=NA,colour = "#AAAAAA",size=2), # set size and colour of panel border panel.grid.major = element_line(colour = "#B0B0B0"), # change grid line colour panel.grid.minor.x = element_blank(), # remove x-axis minor gridlines axis.text = element_text(size=10, colour = "#505050"), # set size and colour of axis text axis.title.x = element_text(vjust=-3,size=10), # set position of x-axis title text axis.title.y = element_text(vjust=+3,size=10), # set position of y-axis title text plot.margin=unit(c(1,1,1.5,1.2),"cm"))+ labs(color="")+xlab("Day of Year") +ylab("Hour of Day") dev.off()