Hi,

I'd like to compare SST data for year 2000 with SST for year 2001. I managed
to get filled contour plots showing monthly SST for both years (12 plots for
each year, 24 plots in total). In order to compare year 2000 and year 2001,
however, I'd need to have the same legend scale (same color bar) in both
years plots.

Thus, my question is: is there a way to set the legend scale in contour
plots?

Considering only year 2000, this is my script:

for (t in 1:12) {
SSTt[,,t]<-t(SST[,,t])

filled.contour(

x=seq(-180,180, length.out=nrow(SSTt[,,t])), y=seq(-90,90,
length.out=ncol(SSTt[,,t])), SSTt[,,t],

xlim=range(seq(-180,180, length.out=nrow(SSTt[,,t])), finite=TRUE),

ylim=range(seq(-90,90, length.out=ncol(SSTt[,,t])), finite=TRUE),

zlim=range(SSTt[,,t], finite=TRUE),

levels=pretty(range(SSTt[,,t], finite=TRUE), nlevels), nlevels=25,

color.palette=heat.colors,

col=color.palette(length(pretty(range(SSTt[,,t], finite=TRUE), nlevels),
nlevels=25)-1),

)

}

When I try to run it, I get this error: Error in n[1L] : object of type
'closure' is not subsettable

Could you please tell me what's wrong?

Cheers

Sarah

	[[alternative HTML version deleted]]

