rolando2
rolando2

Reputation: 408

In R, how to include title when using "plot(region)"?

R's "plot(region)" command does not print out any title--how can I correct this? The "main" command does not work in either of the "plot" lines below.

library(OpenStreetMap)
library(rJava)
library(rgdal)
library(UScensus2000)

data(louisiana.tract)
m65 = na.omit(louisiana.tract@data$age.65.up)
a65 = cut(m65,breaks=c(min(m65),500,750,1000,3500))  
levels(a65) = c("0-500","501-750","751-1000",">1000")

la <- spTransform(louisiana.tract,osm())
lat <- c(30.4, 29.5)
lon <- c(-90.7, -89.5)
region <- openmap(c(lat[1],lon[1]),c(lat[2],lon[2]),zoom=10,'osm')
windows()
plot(region, main = "New Orleans area: \n residents 65 and over by ZIP")
plot(la,add=TRUE,col=c("light cyan","light blue", "cyan" ,"dodgerblue"))
  legend(locator(1), cex=.8, levels(a65), fill=c("light cyan","light blue", "cyan" ,"dodgerblue") )

Upvotes: 0

Views: 3133

Answers (1)

IRTFM
IRTFM

Reputation: 263381

If a plot routine is lacking the "main" argument, you can simply place a "main"-title with:

title( main = "New Orleans area: \n residents 65 and over by ZIP")

Upvotes: 5

Related Questions