Learn R Programming

fanplot (version 2.3)

fan.fill: Plot a Fan Filled with a Single Colour

Description

Plots a single fan representing a percentile range from a set of sequential distributions. Predominantly intended for use within the fan function.

Usage

fan.fill(ts1, ts2, fan.col = "grey", ...)

Arguments

ts1
A single time series percentile of the simulated series from a pn object.
ts2
A single time series percentile of the simulated series from a pn object. Intended to be the same pn object as ts1, but can differ
fan.col
Colour of space between percentile range of distributions
...
Arguments passed to the polygon function (unused for the default method).

Value

  • See Details.

Details

Returns a plot of a single polygon between the selected percentiles. Colours can also be specified in the fan.col argument. Additional arguments are passe to polygon.

See Also

fan, pn, fan.txt

Examples

Run this code
# calculate percentiles across time
th.pn <- pn(sims = th.mcmc)

# set up plot area
plot(svpdx$pdx, type = "n", xlim = c(0, 945), ylim = range(th.pn), ylab = "Theta")

# plot different colours and patterns of shading
fan.fill(th.pn[, "10%"], th.pn[, "90%"])
fan.fill(th.pn[, "10%"] + 1, th.pn[, "90%"] + 2, "red")
fan.fill(th.pn[, "10%"] + 0, th.pn[, "90%"] - 1, adjustcolor("red", 0.2))
fan.fill(th.pn[, "10%"] - 2, th.pn[, "90%"] - 1, angle = 45, density = 10)

Run the code above in your browser using DataLab