# @file NaOR_map.r # @author Martin Brien martin.brien@scotchpartners.com> ################################################################################################### NaOR_map <- function(inputData, zoneName) { assign( paste("plot2_",zoneName,sep=""), ggplot(inputData,aes(x = DT, y = HR, color = P))+ layer(geom = "point",geom_params = list(size=2))+ scale_y_reverse(expand = c(0,0),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_colour_gradient(limits=c(0, 1), low="white", high="red")+ 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)}