Learn R Programming

bReeze (version 0.2-2)

plotProfile: Plot wind profile

Description

Plots wind profiles from a profile object.

Usage

plotProfile(profile, sector, measured=TRUE, ...)
plpro(profile, sector, measured=TRUE, ...)

Arguments

profile
Wind profile object created by profile.
sector
Direction sector as integer (sector number) or string (sector code). If missing or NULL, all sectors are plotted. For plotting the general profile only use "all".
measured
If TRUE, measured sector mean wind speeds are added to the plot.
...
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:
  • 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 set plotted.
  • 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).
  • lty: Line type(s) of the profile lines -- assigned likecol. Seeparfor available line types.
  • lwd: Line width(s) of the profile lines -- assigned likecol. Seeparfor usage.
  • 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 -- default isc(4, 4, 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, 0.7, 0).
  • pos.leg: Position of legend -- one of"bottomright","bottom","bottomleft","left","topleft","top","topright","right"or"center". UseNULLto hide the legend.
  • xlab: Alternative label for the x axis.
  • ylab: Alternative label for the y axis.
  • xlim: Numeric vector of the x limits of the plot.
  • ylim: Numeric vector of the y limits.
  • x.intersp: Horizontal interspacing factor for legend text, as numeric -- default is0.4.
  • y.intersp: Vertical line distance for legend text, as numeric -- default is0.8.

See Also

profile

Examples

Run this code
# load and prepare data
data(winddata)
set40 <- createSet(height=40, v.avg=winddata[,2], dir.avg=winddata[,14])
set30 <- createSet(height=30, v.avg=winddata[,6], dir.avg=winddata[,16])
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)

# create profile
neubuerg.wp <- profile(mast=neubuerg, v.set=c(1,2), dir.set=1, 
  print=FALSE)

# plot all profiles
plotProfile(profile=neubuerg.wp)

# plot only one sector
row.names(neubuerg.wp$profile)	# available sectors
plotProfile(profile=neubuerg.wp, sector=3)	# ENE by sector number
plotProfile(profile=neubuerg.wp, sector="ene")	# ENE by sector code
plotProfile(profile=neubuerg.wp, sector="all")	# general profile

# omit 'measured' points
plotProfile(profile=neubuerg.wp, measured=FALSE)

# customize plot
plotProfile(profile=neubuerg.wp, bty="l", bty.leg="o", cex.axis=0.8, 
  cex.lab=0.9, cex.leg=0.7, col=rainbow(13), col.axis=gray(0.2), 
  col.box=gray(0.2), col.lab=gray(0.2), col.leg=gray(0.2), 
  col.ticks=gray(0.2), las=0, lty=c(rep(3,12),1), 
  lwd=c(rep(1.2,12), 1.7), mar=c(3,3,0.5,0.5), mgp=c(2,0.7,0), 
  pos.leg="right", xlab="velocity [m/s]", ylab="height [m]", 
  xlim=c(0,11), ylim=c(0,150), x.intersp=1, y.intersp=1.2)

Run the code above in your browser using DataLab