Skip to content
Prev 255555 / 398506 Next

filled contour plot with contour lines

On Apr 1, 2011, at 5:38 PM, Steve_Friedman at nps.gov wrote:

            
That suggestion was probably intended to get you a more informative  
error message:

for(j in 1:(varsize[4]-1) )
      temp <- get.var.ncdf(
                    nc=input,
                    varid="p_foraging",
                    c(1,1,j),
                    c(varsize[1],  varsize[2], 1)
                         )

# I think Peter is correct. That loop will complete before the call to  
filled.contour,
#  so you will only have the last version of temp plot.

filled.contour(x, y, temp, color = terrain.colors,
      plot.title = title( main =
              paste("Everglades Wood Stork Foraging Potential \nYear",  
(2000+j)),

#that "double call" to title looks incomplete as well. The comma looks  
premature.
# Shouldn't it be something like:
  plot.title = bquote("Everglades Wood Stork Foraging Potential  
\nYear", .(2000+j) )

#(And since the for loop is already complete `j` will not exist.
# Which is probably the source of the error you are getting.)

             xlab = "UTM East", ylab = "UTM North") ,
             plot.axes = { contour(temp, add=T)
                axis(1, seq(450000 , 580000, by = 10000))
                axis(2, seq(2800000,4000000, by = 10000)) },
             key.title = title(main="Probability") ,
             key.axes = axis(4, seq(0 , 1 , by = 0.1))
David Winsemius, MD
West Hartford, CT