# @file TM52_C2_map.r # @author Martin Brien martin.brien@scotchpartners.com> ################################################################################################### TM52_C2_map <- function(inputData, zoneName) { assign( paste("plot2_",zoneName,sep=""), ggplot(inputData,aes(x = DT, y = HR, color = factor(BINOCT, levels=c("+10","+8","+6","+4","+2","0","-2","-4","-6"))))+ layer(geom = "point",geom_params = list(size=2))+ 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"), limits=c(as.POSIXct('2015/05/01'),as.POSIXct('2015/10/1')))+ scale_color_manual(values = c( "+10"="#EA3A43","+8"="#EF611A","+6"="#F6913A", "+4"="#FEC50E","+2"="#F1EC17","0"="#FEFEFE", "-2"="#7EA4D8","-4"="#487ABE","-6"="#135CAB"))+ 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")+ ggtitle(paste(zoneName)), envir = .GlobalEnv)}