Learn R Programming

bReeze (version 0.1-0)

plotWeibull: Plot wind speed distribution and Weibull fit

Description

Plots the distribution of wind speeds and the fitted weibull distribution from a weibull object.

Usage

plotWeibull(wb, show.ak=FALSE, ...)

Arguments

wb
Weibull object created by weibull.
show.ak
If TRUE, the Weibull parameters A and k are added to the legend.
...
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, used to fill the bars.
  • border: Colour, used for the border around the bars.
  • line: Colour, used for the Weibull fit line.
  • lty: Line type of the Weibull fit line -- seeparfor available line types.
  • lwd: Line width for the Weibull fit line -- seeparfor usage.
  • cex: Numeric value, giving the amount by which text on the plot should be scaled relative to the default (which is 1).

See Also

weibull

Examples

Run this code
# load and prepare data
data(winddata)
set1 <- createSet(height=40, v.avg=winddata[,2], dir.avg=winddata[,14])
ts <- formatTS(winddata[,1])
neubuerg <- createMast(time.stamp=ts, loc=NULL, desc=NULL, set1)
neubuerg <- clean(neubuerg)

# calculate Weibull parameters
neubuerg.wb <- weibull(neubuerg, 1)

# plot
plotWeibull(neubuerg.wb)

# show parameters in legend
plotWeibull(neubuerg.wb, show.ak=TRUE)

# customize bars
plotWeibull(neubuerg.wb, col="lightgray", border="darkgray")
plotWeibull(neubuerg.wb, col=3, border="white", cex=1.2)

# customize line
plotWeibull(neubuerg.wb, line="black", lty="dotdash", lwd=2, cex=0.7)
plotWeibull(neubuerg.wb, line="orange", lty=2, lwd=1.5)

Run the code above in your browser using DataLab