Learn R Programming

fields (version 5.02)

world: Plot of the world

Description

Plots quickly, medium resolution outlines of large land masses and bodies of water.

Usage

world(ylim = c(-90, 90), xlim = NULL, add = FALSE, asp = 1,
                 xlab = "", ylab = "", xaxt = "n", yaxt = "n", eps =
                 0.1, col=1,shift = FALSE, 
                 fill=FALSE, col.water="white", col.land="darkgrey", ...)

world.color(xlim= c(-180,180), ylim=c(-90,90), col.water="white",col.land="darkgrey", ... )

Arguments

Details

Both functions use the FIELDS dataset world.dat for the coordinates. The main advantage of this function is that it is fast and easy to modify. The shift option to center over the dateline is useful because often plots of oceanic and atmospheric information center the map this way.

The function world.color can be used separately but is also called by world with fill being TRUE. When used alone it will just add the colored landmasses and water to an existing plot. It is easy to modify just to add the land masses and use the existing back ground color as water. Unfortunately world.color will not work when shift is TRUE. The current code could be modified if you need this option. Thanks to Steve McIntyre for suggesting and testin the fill option.

See Also

US

Examples

Run this code
world()
# add the US
US( add=TRUE,col="blue")


world( fill=TRUE) # land filled in dark grey 


## Western Europe (*which* big islands are missing?)
## with a coordinate grid:

world(xlim=c(-10,18),ylim=c(36,60), 
    xaxt = "s", yaxt = "s", fill=TRUE, col.land="darkgreen")

box() # add back in the box that was obscured by the ocean fill.

# add back in outline of land.
world( add=TRUE,lwd=1.5, col="green")

grid()

Run the code above in your browser using DataLab