hidden {seas}R Documentation

Get labels and properties for seasonal graphs

Description

Get title, x-axis labels and colours for seasonal graphs. Also, draw the month grid.

Usage

.seasxlab(width)
.seastitle(main=NULL, id=NULL, name=NULL, orig=NULL, fun=NULL,
  range=NA, show.range=TRUE, show.id=TRUE, style=c(1,NA), ...)
.seascols(precip.only=NULL, style=c(NA,1), lwd=NULL, ...)
.seasmonthgrid(month.abb=TRUE, month.len=NULL, month.force=FALSE,
  month.draw=TRUE, width, num, month.col="lightgrey", month.lwd=1, ...)

Arguments

width size of bin; see mkfact
num number of bins; if omitted, will calculate from width
main main title of plot; overrides any other title, but appends year range if show.range=TRUE
id station ID, which is used to fetch a station name using getstnname
name a name, which is used in preference to the name retrieved from getstnname
orig original object name, which is used if no other name can be found from id or name
fun function, if applicable
range year range in the format c( start , end ) years
show.range logical
show.id logical
style specified as c(title,colours), which are pre-determined styles for plot, see details below
precip.only logical; specify if colours need to be produced for precipitation only, or for rain and snow
lwd line width to be used for plots: for plot.seas.temp, this changes the width of the diurnal variability lines; for image.seas.sum, this changes the thickness of the median and mean lines
month.abb logical; abbreviate month names (using the "%b" format), or use the normal month names (using the "%B")
month.len length of the month names, for instance, will use J-F-M-... (in English locale) if month.len=1
month.force logical; force month labels to be drawn for each month (uses mtext; labels may overlap); or let axis place labels (default)
month.draw logical; place month labels (grid will be drawn regardless)
month.col colour for month grid; default is "lightgrey"
month.lwd line width for month grid; default is 1
... not used

Details

These functions are called by the seasonal plot functions in seas for consistent display of title, x-axis labels and colours. These functions are ready to have translations for non-English languages built into them. Month names currently translate according to your operating system and locale settings.

style can be passed to the ‘...’ parameter for most plotting functions in seas to modify the look. It can be passed in the format c(title,colours), where each are integers, explained below.

Title styles:

Colour styles:

Also, other details, such as the back-ground colour, font family, may be adjusted by setting parameters using the par function before plotting. For example, setting par(cex=0.75) will reduce the font size in the active device by 75% of the original size.

Value

.seasxlab returns a character label.
.seastitle returns a list.

Author(s)

M.W. Toews

See Also

getstnname

Examples

par.orig <- par(no.readonly=TRUE)
on.exit(par(par.orig))

.seasxlab(11)
.seasxlab("mon")

data(mscdata)

## Not run: 
par(family="serif",cex=1.2)
## End(Not run)
plot.seas.temp(mscdata, width=11, id=1108447,
  style=c(1,1), month.len=1)

## Not run: 
par(family="sans",cex=0.8)
## End(Not run)
plot.seas.temp(mscdata, width=365/12, id=1108447,
  style=c(2,0), month.abb=FALSE)

## Not run: 
par(family="mono",cex=1)
## End(Not run)
plot.seas.temp(mscdata, width="mon",  id=1108447,
  style=c(0,2))

# make a professional EPS figure for a publication:
## Not run: 
postscript("fig2_temperature.eps",
  width=5,height=3,horizontal=FALSE,onefile=TRUE,
  paper="special")
par(cex=0.6,lwd=0.8)
plot.seas.temp(mscdata,id="1108447",style=c(3,2))
dev.off()
## End(Not run)

[Package seas version 0.2-1 Index]