Hi all,

I'm plotting 3 sets of climate data in a 6 panel plot.  The top row will be
30 year precipitation normals, and the bottom row will be 30 year
temperature normals.  The top row must be plotted with all 3 datasets on
the same legend scale, as with the bottom.

I have everything in the plot just how I want it, except the legend text
size needs to be larger.  I've explored the raster:::plot and
fields:::image.plot help pages pretty extensively, and have not been able
to find a solution.  Does anyone know how I can do this?

Here's a code you can  use to plot, which has the same extent and value
ranges as my original data.  The code is a bit long, but the calls to plot
are basically the same with only the object and title changing.  Sorry if
it's unnecessarily confusing, and thanks in advance for any suggestions.

-Andrew

#===============================================================================
#Set up fake data similar to real data
library(raster)

e <- extent(c(-125, -114, 32, 42))
p.ppt <- raster(nrow = 1200, ncol = 1320, ext = e,
                crs = '+proj=longlat +datum=WGS84 +ellps=WGS84
+towgs84=0,0,0')

c.ppt <- raster(nrow = 20, ncol = 22, ext = e,
                crs = '+proj=longlat +datum=WGS84 +ellps=WGS84
+towgs84=0,0,0')

ud.ppt <- raster(nrow = 20, ncol = 22, ext = e,
                crs = '+proj=longlat +datum=WGS84 +ellps=WGS84
+towgs84=0,0,0')

p.ppt[] <- runif(n = ncell(p.ppt), min = 50, max = 4180)
c.ppt[] <- runif(n = ncell(c.ppt), min = 0, max = 1817)
ud.ppt[] <- runif(n = ncell(ud.ppt), min = 72, max = 1860)

#===============================================================================
#Plot

#set up legend breaks, arguments, ticks, and axis arguments to be used in
all
#6 plots for this example

brks <- seq(50, 4550, by = 1)
nb <- length(brks) - 1
cols <-  colorRampPalette(c('blue', 'green', 'yellow', 'orange', 'red'))
leg.args <- list(text = 'mm', cex = 1, side = 3, line = 1)
ticks <- seq(50, 4550, by = 500)
ax.args <- list(at = ticks, labels = ticks, cex = 1.5)

par(mfrow=c(2,3), mar = c(4, 5, 3, 6) + 0.1)



#plot out all 6 panes using the same legend scale for all of them.
#Do you know how I can change the legend text size??

plot(p.ppt, breaks = brks, lab.breaks = brks, col = cols(nb), zlim = c(50,
4550),
    main = 'Simulated PRISM Precip', xlab = '', ylab = 'Latitude',
    legend.width = 1.25, legend.args = leg.args, axis.args = ax.args,
cex.main = 1.7,
    cex.axis = 1.5, cex.sub = 1.5, cex.lab = 1.6)

plot(c.ppt, breaks = brks, lab.breaks = brks, col = cols(nb), zlim = c(50,
4550),
    main = 'Simulated CRU TS3.21 Precip', xlab = '', ylab = '',
    legend.width = 1.25, legend.args = leg.args, axis.args = ax.args,
cex.main = 1.7,
    cex.axis = 1.5, cex.sub = 1.5, cex.lab = 1.6)

plot(ud.ppt, breaks = brks, lab.breaks = brks, col = cols(nb), zlim = c(50,
4550),
    main = 'Simulated UDEL 3.02 Precip', xlab = '', ylab = '',
    legend.width = 1.25, legend.args = leg.args, axis.args = ax.args,
cex.main = 1.7,
    cex.axis = 1.5, cex.sub = 1.5, cex.lab = 1.6)

#Start second row.  Actual data switches to temperature, but this is simpler
plot(p.ppt, breaks = brks, lab.breaks = brks, col = cols(nb), zlim = c(50,
4550),
    main = 'Simulated PRISM Precip', xlab = 'Longitude', ylab = 'Latitude',
    legend.width = 1.25, legend.args = leg.args, axis.args = ax.args,
cex.main = 1.7,
    cex.axis = 1.5, cex.sub = 1.5, cex.lab = 1.6)

plot(c.ppt, breaks = brks, lab.breaks = brks, col = cols(nb), zlim = c(50,
4550),
    main = 'Simulated CRU TS 3.21 Precip', xlab = 'Longitude', ylab =
'Latitude',
    legend.width = 1.25, legend.args = leg.args, axis.args = ax.args,
cex.main = 1.7,
    cex.axis = 1.5, cex.sub = 1.5, cex.lab = 1.6)

plot(ud.ppt, breaks = brks, lab.breaks = brks, col = cols(nb), zlim = c(50,
4550),
    main = 'Simulated UDEL 3.02 Precip', xlab = 'Longitude', ylab =
'Latitude',
    legend.width = 1.25, legend.args = leg.args, axis.args = ax.args,
cex.main = 1.7,
    cex.axis = 1.5, cex.sub = 1.5, cex.lab = 1.6)

-- 
*Andrew P. Vitale*
Masters Student
Department of Geography
University of Nevada, Reno
(412) 915-3632
vitale232@gmail.com

	[[alternative HTML version deleted]]

