Learn R Programming

gmt (version 1.0-0)

psbar: Add Bars to GMT Mercator Map

Description

Call GMT to add bars to the active map and save in postscript format. This function does the necessary calculations to render bars in standard height given a Mercator-projected map. It is not intended for other projections.

Usage

psbar(x, cmd="-JM -R -W1p -G180 -O -K", file=options("gmt.file"), ref=0,
      digits=options("digits"))

Arguments

x
data frame, matrix, or filename containing the data to be plotted
cmd
string of arguments passed to psxy
file
filename where the map is saved
ref
reference latitude where Height=1 renders a bar 1 degree high
digits
precision used when rounding the geographic coordinates

Value

  • Null, but the map is annotated and saved in postscript format. As a side product, a temporary file lastBAR.gmt is saved in the working directory.

Details

The data are arranged in four columns: Lon, Lat, Width, and Height, in that order. See the GMT documentation for details on psxy and other GMT commands.

References

Wessel, P. and W.H.F. Smith. 2004. The Generic Mapping Tools: Technical reference and cookbook. Version 4. Available at http://gmt.soest.hawaii.edu/gmt/doc/pdf/GMT$\_$Docs.pdf.

See Also

gmt initializes the GMT session, pscoast draws a map, psxy, pstext and psbar annotate the map, and psclose finalizes the postscript file. See r2gmt for valid data file format when argument x is a filename.

Examples

Run this code
gmt(demo.par)
pscoast(demo.coast)
psxy(demo.xy)
pstext(demo.text)
psbar(demo.bar, ref=64)
psclose()

Run the code above in your browser using DataLab