# @file TM52_C2_scatter.r # @author Martin Brien martin.brien@scotchpartners.com> ################################################################################################### TM52_C2_scatter <- function(inputData, zoneName) { assign( paste("plot5_",zoneName,sep=""), ggplot()+ layer( data = inputData, mapping = aes(x = DT, y = OAT), geom = "line", geom_params = list(size=0.1,color = "steelblue"))+ layer( data = inputData, mapping = aes(x = DT, y = IOT), geom = "point", geom_params = list(size=1,color = "grey",shape=1))+ # layer( # data = inputData, # mapping = aes(x = DT, ymin =(CT-3), ymax = (CT+3)), # geom = "ribbon", # geom_params = list(fill = "green", alpha = 0.5))+ layer( data = inputData, mapping = aes(x = DT, y = ULIM), geom = "line", geom_params = list(size=1,color = "red"))+ 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_y_continuous(limits = c(0, 50),expand = c(0,0))+ theme( panel.background = element_rect(fill = 'white'), panel.grid.major = element_line(colour = "#B0B0B0"), panel.grid.minor.x = element_blank(), panel.grid.minor.y = element_blank(), axis.text = element_text(size=10, colour = "#505050"), axis.title.x = element_text(vjust=-3,size=10), axis.title.y = element_text(vjust=+3,size=10), panel.border = element_rect(fill=NA,colour = "#AAAAAA",size=2), 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)}