
Hi,

I'm am layering two quilt.plot functions on the same plot. The first is a number of points with a scale that has been grayed out just to show the location of the data. The second layer has colors, but only those data points with statistically significant data are shown, which means that of the 77 possible data points (all included in the grayed out plot), only 3 are anything but NA. The problem is that the statistically significant colored data shows up only as tiny little specks (I had to really look to see that it had even plotted anything). I can't figure out why it is doing this. Why are the squares not the same size as the underlying quilt.plot? The coordinates, etc are all the exact same.

I've pasted all of my code below and bolded the relevant parts. (I can send the input files if that would help). 

Many thanks!!
Erika.


## load the shapefiles for the map background:
getinfo.shape('D:/arcGIS/england boundary/england.shp')
england<-readShapePoly('D:/arcGIS/england boundary/england.shp')
class(england)
## look at the .prj file in notepad or similar to figure out the projection of the shapefile
## can google the Proj4 code needed at this website: http://www.spatialreference.org
## page for the standard -180 to 180 long & -90 to 90 lat system (WGS84): http://spatialreference.org/ref/epsg/4326/
proj4string(england)<-CRS('+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601271625 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs')
# transform the map into the WGS84 projection (epsg:4326):
england.wgs<-spTransform(england, CRS('+init=epsg:4326'))

## read in satellite data:
sat<-read.csv('with ll_grid trends_satellite_gome.2.3.11.csv', header=TRUE)
head(sat)
sat[sat=='-999']<-NA

## read in observational data:
obs.yr<-read.csv('with coord_obs log data trends gome years deseason.8.11.10.csv', header=TRUE)
head(obs.yr)
obs.yr[obs.yr=='-999']<-NA
## obs data to plot:
plot.obs<- obs.yr$sig
plot.obs.ns<- obs.yr$perc_per_year_ds

## define gray scale for plotting:
# satellite grays
grays<-two.colors(n=10, start='gray', end='gray', middle='gray')
# obs grays
grays.ns<-two.colors(n=10, start='lightgray', end='lightgray', middle='lightgray')

## define number of color to be used in plot
nclr<-10
## define color palette/scale
plotclr<-tim.colors(n=nclr)
## define color intervals and color code for plotting sig (e.g., apply color code to data)
class<-classIntervals(plot.obs, nclr, style='fixed', 
    fixedBreaks=c(-40, -10, -7.5, -5, -2.5, 0, 2.5, 5, 7.5, 10, 40))
colcode<- findColours(class, plotclr)
## define as above, but for all points, not sig incl.
class.ns<-classIntervals(plot.obs.ns)
colcode.ns<-findColours(class.ns, grays.ns)

## plot:
pdf(file='map plot satellite gome vs years.26.7.11.pdf', w=11.7, h=8.3, version='1.4')
#plot gridded sat data, with legend, grayed out:
quilt.plot(sat$grid_long, sat$grid_lat, sat$perc_per_year, col=grays, 
    breaks=c(-40, -10, -7.5, -5, -2.5, 0, 2.5, 5, 7.5, 10, 40),
    xlim=c(-3,2), ylim=c(50.5,52.5), xlab="Longitude", ylab="Latitude", 
    font.axis = 1, font.lab = 1, zlim=c(-40,40),
    cex.axis = 1.0,cex.lab = 1.0, main='GOME & year matched data',
    nrow=32, ncol=80)
#add map outline:
plot(england.wgs, add=TRUE)
#add obs data (not gridded):
points(obs.yr$Longitude, obs.yr$Latitude, pch=16, col=colcode.ns, cex=1)

#plot gridded sat data, with legend, significant data with color:
quilt.plot(sat$grid_long, sat$grid_lat, sat$sig,
    breaks=c(-40, -10, -7.5, -5, -2.5, 0, 2.5, 5, 7.5, 10, 40), col=tim.colors(nclr),
    zlim=c(-40,40), xlab="Longitude", ylab="Latitude", nrow=32, ncol=80,
    font.axis = 1, font.lab = 1, xlim=c(-3,2), ylim=c(50.5,52.5),
    cex.axis = 1.0,cex.lab = 1.0, main='GOME & year matched data', add=TRUE)
#add map outline:
#plot(england.wgs, add=TRUE)
#add obs data (not gridded):
points(obs.yr$Longitude, obs.yr$Latitude, pch=16, col=colcode, cex=1)
mtext(text=expression("Trend (% yr "^-1*") "), side=4, line=4)
dev.off()


 		 	   		  
	[[alternative HTML version deleted]]

