hidden {seas} | R Documentation |
Get title, x-axis labels and colours for seasonal graphs. Also, draw the month grid.
.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, ...)
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 |
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:
0
no title, par(mar)
is adjusted to
acomodate more space for the figure
1
‘[name] [id] [from
start to [end]]’
2
‘[name] [id] [\n
start - [end]]’ (spans two lines)
Colour styles:
0
black & white theme: all box-plots are clear, lines
are all black, precipitation or snow have a line density fill of 20
and angle of 45, rain has a line density of 10 and an angle of -45
1
, colour theme: precipitation or rain are
‘lightblue’, snow is ‘grey’, temperature boxplots are
‘lightgrey’, diurnal temperature lines are ‘red’, wet
boxplots are ‘lightblue’, dry boxplots are ‘orange’,
and NA
marks are ‘red’
2
, grey-scale theme: precipitation or rain are
‘grey80’, snow is ‘grey60’, temperature boxplots are
‘grey70’, diurnal temperature lines are ‘grey20’, wet
boxplots are ‘grey70’, dry boxplots are ‘grey50’,
and NA
marks are ‘grey30’
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.
.seasxlab returns a character
label.
.seastitle returns a list
.
M.W. Toews
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)