Learn R Programming

bReeze (version 0.3-2)

plotMonthStats: Plot monthly means

Description

Plots monthly means of wind speed from a monthStats object.

Usage

plotMonthStats(stats, set, ...)
plms(stats, set, ...)

Arguments

stats
Monthly means created by monthStats.
set
Set used for plotting specified as set number or set name. Argument is optional -- if missing, all sets in stats are plotted.
...
Optional graphical parameters, see below for details.

encoding

UTF-8

Optional graphical parameters

The following graphical parameters can optionally be added to customize the plot:
  • border: Colour to be used for the border of the bars -- default value is"black". Useborder=NAto omit borders.
  • bty: Type of box to be drawn around the plot region. Allowed values are"o"(the default),"l","7","c","u", or"]". The resulting box resembles the corresponding upper case letter. A value of"n"suppresses the box.
  • bty.leg: Type of box to be drawn around the legend. Allowed values are"n"(no box, the default) and"o".
  • cex: Amount by which text on the plot should be scaled relative to the default (which is1), as numeric. To be used for scaling of all texts at once.
  • cex.axis: Amount by which axis annotations should be scaled, as numeric value.
  • cex.lab: Amount by which axis labels should be scaled, as numeric value.
  • cex.leg: Amount by which legend text should be scaled, as numeric value.
  • col: Vector of colours, one for each year in the measurement period.
  • col.axis: Colour to be used for axis annotations -- default is"black".
  • col.box: Colour to be used for the box around the plot region (ifbty) -- default is"black".
  • col.lab: Colour to be used for axis labels -- default is"black".
  • col.leg: Colour to be used for legend text -- default is"black".
  • col.ticks: Colours for the axis line and the tick marks respectively -- default is"black".
  • las: Style of axis labels. One of0(always parallel to the axis, default),1(always horizontal),2(always perpendicular to the axis),3(always vertical).
  • legend: IfTRUE(the default) a legend is drawn.
  • mar: A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot (only for plots with one dataset) -- default isc(4, 5, 1, 1).
  • mgp: A numerical vector of the form c(label, annotation, line), which gives the margin line for the axis label, axis annotation and axis line. The default isc(2.5, 1, 0).
  • plot.names: IfTRUE(the default), the names of the datasets is plotted as second label of the y axis.
  • pos.leg: Position of legend -- one of"bottomright","bottom","bottomleft","left","topleft",top,"topright","right"or"center".
  • xlab: Alternative label for the x axis.
  • ylab: Alternative label for the y axis.
  • ylim: Limits of the y axis, as vector of two values.
  • x.intersp: Horizontal interspacing factor for legend text, as numeric -- default is0.4.

See Also

monthStats

Examples

Run this code
# load and prepare data
data(winddata)
set40 <- createSet(height=40, v.avg=winddata[,2])
set30 <- createSet(height=30, v.avg=winddata[,6])
set20 <- createSet(height=20, v.avg=winddata[,10])
ts <- formatTS(time.stamp=winddata[,1])
neubuerg <- createMast(time.stamp=ts, set40, set30, set20)
neubuerg <- clean(mast=neubuerg)

# calculate stats
neubuerg.stats <- monthStats(mast=neubuerg, print=FALSE)

# plot all datasets
plotMonthStats(stats=neubuerg.stats)

# plot one dataset
plotMonthStats(stats=neubuerg.stats, set=1)
plotMonthStats(stats=neubuerg.stats, set="set1")	# same as above

# customize plot
plotMonthStats(stats=neubuerg.stats, border="darkgray", bty="l", cex.axis=0.7, 
  cex.lab=0.9, col=c(gray(0.3), gray(0.7)), col.axis="darkgray", 
  col.box="darkgray", col.lab="darkgray", col.ticks="darkgray", las=0, 
  legend=FALSE, mgp=c(2, 0.7, 0), plot.names=FALSE, ylim=c(0,7), 
  ylab="Wind speed [m/s]")

Run the code above in your browser using DataLab