• Products
  • Statistics and Data Mining Solutions
  • Statistics and Data Mining Services
  • Statistics and Data Mining Resources
  • Support
  • Events
  • Company
Products

S-PLUS Graphlets™ Gallery

Earthquake Code

library(maps)
library(winspj)
quake <- read.table("gridxyz.txt",skip=T,header=F)
names(quake) <- c("lon","lat","pga","pgv", "mmi","psa03","psa10", "psa30")
x <- unique(quake$lon)
y <- unique(quake$lat)
z <- matrix(quake$mmi, ncol=81, nrow=121)
# graphsheet(image.color.scheme="topographical")
java.graph("earthquake.spj", colorscheme=java.colorscheme.topographical)
par(mar=c(5,4,4,8)+0.1)
image(x,y,z)
image.legend(z,x=c(-120.786, -120.542),y=c(47.688, 46.338),horiz=F)
title("Seattle-area earthquake intensity, Feb 28 2001")
text(-120.658, 47.817, lab="Intensity")
xlim <- range(x)
ylim <- range(y)
map("world","usa", xlim=xlim,ylim=ylim,add=T,lwd=2)
## Approximate locations of measuring stations
JCW <- c(-121.9381,48.27071)
GNW <- c(-122.8186,47.61711)
FMW <- c(-121.5448,46.47939)
points(JCW[1],JCW[2],col=0)
text(JCW[1],JCW[2],lab=" JCW",adj=0,col=0)
points(GNW[1],GNW[2],col=0)
text(GNW[1],GNW[2],lab=" GNW",adj=0,col=0)
points(FMW[1],FMW[2],col=0)
text(FMW[1],FMW[2],lab=" FMW",adj=0,col=0)
links <- paste(
  "http://www.geophys.washington.edu/SEIS/PNSN/WEBICORDER/",
  c(,"JCW_EHZ","GNW_BHZ","FMW_EHZ"),"_UW.2001022812.html",sep="")
java.identify(c(JCW[1],GNW[1],FMW[1]),c(JCW[2],GNW[2],FMW[2]),labels=
	c("JCW EHZ UW : Jim Creek, West Cascades","GNW BHZ UW : Green Mt., Kitsap",
	"FMW EHZ UW : Mount Fremont, Mount Rainier"), actions=java.action.link(links))
dev.off()