Learn R Programming

bReeze (version 0.1-0)

plotProfile: Plot wind profile

Description

Plots wind profiles from a profile object.

Usage

plotProfile(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.
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:
  • col: Colour(s) of the profile lines -- either one colour (which is repeated) or a vector with the length of sector numbers + 1, where the last colour is used for the general profile.
  • 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.
  • cex: Numeric value, giving the amount by which text on the plot should be scaled relative to the default (which is 1).
  • xlim: Numeric vector of the x limits of the plot.
  • ylim: Numeric vector of the y limits.

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(winddata[,1])
neubuerg <- createMast(time.stamp=ts, loc=NULL, desc=NULL, 
	set40, set30, set20)
neubuerg <- clean(neubuerg)

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

# plot all profiles
plotProfile(neubuerg.wp)

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

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

# customize plot
plotProfile(neubuerg.wp, sector="s", col=1, lty=4, lwd=2, cex=1.3, 
	xlim=c(0,6), ylim=c(0,100))
plotProfile(neubuerg.wp, col=rainbow(13), lty=c(rep(3,12),1), 
	lwd=c(rep(0.8,12), 1.5), ylim=c(0,100))
plotProfile(neubuerg.wp, measured=FALSE, col=c(gray(1:12 / 13), "black"), 
	lty=1, lwd=c(rep(1,12), 3), xlim=c(1,10))

Run the code above in your browser using DataLab