Learn R Programming

bReeze (version 0.2-2)

plotFrequency: Plot frequency data

Description

Plots joint probability of wind speeds and directions from a frequency object in a rose plot.

Usage

plotFrequency(freq, ...)
plfreq(freq, ...)

Arguments

freq
Frequency object created by frequency.
...
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.leg: Border colour(s) for the legend. One colour for each wind speed bin or a single colour -- default is same ascol.
  • 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.
  • circles: Manual definition of circles to be drawn, as numeric vector of the form c(inner circle, outer circle, interval between the circles).
  • col: Vector of colours -- one colour for each wind speed bin or a single colour iffrequencyonly contains the total frequency per direction sector.
  • col.axis: Colour to be used for axis annotations -- default is"gray45".
  • col.border: Colour to be used for sector borders -- default isNULL(no border is drawn).
  • col.circle: Colour to be used for circles -- default is"gray45".
  • col.cross: Colour to be used for axis lines -- default is"gray45".
  • col.lab: Colour to be used for axis labels -- default is"black".
  • col.leg: Colour to be used for legend text -- default is"black".
  • fg: IfTRUE, sectors are plotted in foreground (on top of axis lines and circles) -- default isFALSE.
  • lty.circle: Line type of circles -- default is"dashed". Seeparfor available line types.
  • lty.cross: Line type of axis lines -- default is"solid". Seeparfor available line types.
  • lwd.border: Line width of the sector borders -- default is0.5. Only used ifcol.borderis set.
  • lwd.circle: Line width of circles, as numeric value -- default is0.7.
  • lwd.cross: Line width of axis lines, as numeric value -- default is0.7.
  • pos.axis: Position of axis labels in degree, as numeric value -- default is60.
  • sec.space: Space between plotted sectors, as numeric value between0and1-- default is0.2.
  • title.leg: Alternative legend title, as string.
  • width.leg: Widths of legend space relative to plot space, as numeric value between0and1. If0, the legend is omitted, default value is0.15.
  • 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.4.

See Also

frequency

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)

# calculate frequency
neubuerg.freq <- frequency(mast=neubuerg, v.set=1, print=FALSE)
neubuerg.freq.2 <- frequency(mast=neubuerg, v.set=1, bins=NULL, 
  print=FALSE)

# plot frequency
plotFrequency(freq=neubuerg.freq)
plotFrequency(freq=neubuerg.freq.2)

# change colours
plotFrequency(freq=neubuerg.freq, col=gray(5:0 / 5.5))

# change text sizes
plotFrequency(freq=neubuerg.freq, cex=0.8)

# manual definition of circles
plotFrequency(freq=neubuerg.freq, circles=c(10, 30, 10))

# plot sectors in foreground
plotFrequency(freq=neubuerg.freq, fg=TRUE)

# change position of axis labels
plotFrequency(freq=neubuerg.freq, pos.axis=135)

# no legend
plotFrequency(freq=neubuerg.freq, width.leg=0)

# freaky
plotFrequency(freq=neubuerg.freq, border.leg=heat.colors(5), bty.leg="o", 
  cex.axis=0.5, cex.lab=2, cex.leg=0.5, circles=c(5, 30, 5), 
  col=rainbow(5), col.axis="green", col.border="orange", 
  col.circle="purple", col.cross="yellow", col.lab="pink", 
  col.leg="lightblue", fg=TRUE, lwd.border=2, lwd.circle=3, lwd.cross=3, 
  lty.circle="12345678", lty.cross="87654321", sec.space=0.6, 
  title.leg="* WiNd SpEeD *", x.intersp=2, y.intersp=5)

Run the code above in your browser using DataLab