# R script to make a ship series figure # We're going to use grid graphics library(grid) library(lattice) library(maps) # put the output in a PS file #postscript(file="Nimrod2_series.ps",pointsize=14) png(file="Nimrod2_series.png",width=900,height=600,pointsize=14) # Base the structure on a graph of surface data Series <- read.table("../series_files/Nimrod2",na.strings = 'Na') # Load the plotting functions source("../scripts/series_utility_fns.R") # Arrange the viewports for the map and the three series plots pushViewport(viewport(width=0.3,height=1.0,x=0,y=0.0, just=c("left","bottom"),name="vp_map")) upViewport(0) pushViewport(viewport(width=0.7,height=0.3,x=0.3,y=0.7, just=c("left","bottom"),name="vp_slp")) upViewport(0) pushViewport(viewport(width=0.7,height=0.3,x=0.3,y=0.4, just=c("left","bottom"),name="vp_temperature")) upViewport(0) pushViewport(viewport(width=0.7,height=0.3,x=0.3,y=0.0, just=c("left","bottom"),name="vp_ice")) upViewport(0) # Draw the map in the left viewport downViewport("vp_map") print(sr.map(Series$V11,Series$V12,Series$V2,col=4,cex=1.5, base_lon=180,lon_range=c(135,225),lat_range=c(-90,-30)), newpage=F,prefix="map1") upViewport() # Draw the time-series plots downViewport("vp_slp") slpPlot(Series$V2,Series$V9) upViewport() downViewport("vp_temperature") tPlot(Series$V2,Series$V5-Series$V6,Series$V7-Series$V8) upViewport() downViewport("vp_ice") icePlot(Series$V2,Series$V3,Series$V4) upViewport() # Exit R q('no')