
Last chance! 50% off unlimited learning
Sale ends in
A two dimensional matrix is plotted as a bipartite graph.
plotweb(web,
method = "cca", empty = TRUE, labsize = 1, ybig = 1, y.width.low = 0.1,
y.width.high = 0.1, low.spacing = NULL, high.spacing = NULL,
arrow="no", col.interaction="grey80", col.high = "grey10",
col.low="grey10", bor.col.interaction ="black", bor.col.high="black",
bor.col.low="black", high.lablength = NULL, low.lablength = NULL,
sequence=NULL, low.abun=NULL, low.abun.col="green",
bor.low.abun.col ="black", high.abun=NULL, high.abun.col="red",
bor.high.abun.col="black", text.rot=0, text.high.col="black",
text.low.col="black", adj.high=NULL, adj.low=NULL, plot.axes = FALSE,
low.y=0.5, high.y=1.5, add=FALSE, y.lim=NULL, x.lim=NULL, low.plot=TRUE,
high.plot=TRUE, high.xoff = 0, low.xoff = 0, high.lab.dis = NULL,
low.lab.dis = NULL, abuns.type="additional")
Web is a matrix representing the interactions observed between higher trophic level species (columns) and lower trophic level species (rows). Usually this will be number of pollinators on each species of plants or number of parasitoids on each species of prey.
Default method is cca, which leads to as few crossings of interactions as possible. The other option is normal, which leaves order as given by the matrix.
logical; should empty columns or empty rows be omitted from plotting; defaults to true
factor for size of labels, default is 1
vertical distance between upper and lower boxes, default is 1
width of lower boxes, default is 0.1
width of upper boxes, default is 0.1
distance between lower boxes, default is NULL, so automatically spaced that length of upper and lower boxes is the same. Be aware if set to any value that x.lim may has to be adjusted to ensure that the network is not plotted outside the plotting region
distance between upper boxes, default is is NULL, so automatically spaced that length of upper and lower boxes is the same. Be aware if set to any value that x.lim may has to be adjusted to ensure that the network is not plotted outside the plotting region
display type of connection between upper and lower boxes, options are up, down, both, up.center, down.center, both.center and no, default is no, which is a polygonal connection between boxes.
color of interaction, default is grey80.
color of upper boxes, default is grey10.
color of lower boxes, default is grey10.
border color of interaction, default is black
border color of upper boxes, default is black
border color of lower boxes, default is black
number of characters of upper labels that should be plotted. If zero no labels are shown, default is NULL which plots the complete labels.
number of characters of lower labels that should be plotted. If zero no labels are shown, default is NULL which plots the complete labels.
list of two with two names vectors: seq.high
and seq.low
, which specify the order in which species are plotted. Cannot be set for method="cca". Defaults to NULL
, where the sequence remains as given or is determined by the CCA internally.
Named vector with independent abundance estimates for the lower trophic level, NULL if none exists. See Notes!
Colour for depicting the abundance estimates for the lower trophic level; defaults to green.
border color for depicting the abundance estimates for the lower trophic level, default is black
Named vector with independent abundance estimates for the higher trophic level, NULL if none exists. See Notes!
Colour for depicting the abundance estimates for the lower trophic level; defaults to red.
border color for depicting the abundance estimates for the higher trophic level, default is black
orientation of labels in the plot (to avoid overlapping of horizontal labels if dimension of the webs are high), default is 0 for horizontal labels, use text.rot=90 for vertical labels.
Colour for text labels of higher trophic level, a vector of colours can be given
Colour for text labels of lower trophic level. A vector of colours can be given
Adjust upper labels. See adj in ?text how to adjust labels
Adjust upper labels. See adj in ?text how to adjust labels
axis are plotted. Sometimes useful to place boxes in higher order plots. Defaults to FALSE
Position of the higher boxes on the y-axis. Defaults to 1.5
Position of the higher boxes on the y-axis. Defaults to 1.5
if set to TRUE a new bipartite network is added to the previous plot. In this way multitrophic webs can be plotted, see examples below. Defaults to FALSE.
To set limits for y-axis. Useful if labels are plotted outside the plotting region and for multitrophic plots, see examples below
To set limits for x-axis. Useful if labels are plotted outside the plotting region and for multitrophic plots, see examples below
Defines if lower boxes should be drawn. Use in multitrophic plots to avoid plotting boxes of some trophic levels - see examples below. Defaults to TRUE
Defines if higher boxes should be drawn. Use in multitrophic plots to avoid plotting boxes of some trophic levels - see examples below. Defaults to TRUE
allows to set an offset to upper boxes. Useful if high.spacing is used to centre boxes manually. Use plot.axes=TRUE for easy centring
allows to set an offset to lower boxes. Useful if low.spacing is used to centre boxes manually. Use plot.axes=TRUE for easy centring
normally labels are staggered to avoid plotting over themselves. if set to 0, higher labels are all on one horizontal line. By using ad.low the position of the labels can be adjusted. If set to any other value labels are staggered with this distance. Defaults to NULL
normally labels are staggered to avoid plotting over themselves. if set to 0, lower labels are all on one horizontal line. By using ad.low the position of the labels can be adjusted. If set to any other value labels are staggered with this distance. Defaults to NULL
How to plot abundances - are they independent (e.g. flower cover) measurements or are they additional (e.g. unparasitised hosts) measurements? Defaults to additional. Option none is interpreted in the same way as additional. See Notes!
Returns a window with a bipartite graph of a food web. For all colours vectors can be used (which are recycled if length differs. Now more trophic webs can be plotted by using plotweb
and the add switch, which allows to add more webs and staggering them on top of each other. Preferred option is here to order webs by yourself and use method="normal" to keep your preferred order. See examples on three and four trophic networks.
Tylianakis, J. M., Tscharntke, T. and Lewis, O. T. (2007) Habitat modification alters the structure of tropical host-parasitoid food webs. Nature 445, 202--205
For a different plot of food webs see visweb
# NOT RUN {
data(Safariland)
plotweb(Safariland)
# shorter labels
plotweb(Safariland, high.lablength=3, low.lablength=0, arrow="down")
# centered triangles for displaying interacions
plotweb(Safariland, text.rot=90, arrow="down.center", col.interaction="wheat2",
y.lim=c(-1,2.5))
#orginal sequence, up arrows and different box width
plotweb(Safariland, method="normal", arrow="up", y.width.low=0.3, low.lablength=4)
# interactions as lines
plotweb(Safariland, arrow="both", y.width.low=0.05, text.rot=90, col.high="blue",
col.low="green")
# add an abundance vector for lower trophic species
low.abun = round(runif(dim(Safariland)[1],1,40)) #create
names(low.abun) <- rownames(Safariland)
plotweb(Safariland, text.rot=90, low.abun=low.abun, col.interaction="purple",
y.width.low=0.05, y.width.high=0.05)
plotweb(Safariland, text.rot=90, low.abun=low.abun, col.interaction ="red",
bor.col.interaction="red", arrow="down")
# now vectors for all colours can be given, to mark certain species or
# interactions. Colour vectors are recycled if not of appropriate length
plotweb(Safariland,col.high=c("orange","green"))
plotweb(Safariland,col.low=c("orange","green"),col.high=c("white","grey","purple"),
text.high.col=c("blue","red"), col.interaction=c("red",rep("green",26),rep("brown",242)),
bor.col.interaction=c(rep("green",26),rep("brown",242)),method="normal",
text.rot=90, low.lablength=10, high.lablength=5)
#example one (tritrophic)
plotweb(Safariland,y.width.low=0.1, y.width.high=0.05,method="normal",
y.lim=c(0,3), arrow="up", adj.high=c(0.5,1.5), col.high="orange",
high.lablength=3,high.lab.dis=0)
plotweb(t(Safariland), y.width.low=0.05, y.width.high=0.1, method="normal",
add=TRUE,low.y=1.5,high.y=2.5, col.low="green", text.low.col="red",
low.lab.dis=0, arrow="down", adj.low=c(0.5,1.1),low.plot=FALSE)
#example two (4 trophic with abundance)
low.abun = round(runif(dim(Safariland)[1],1,40)) #create
names(low.abun) <- rownames(Safariland)
plotweb(Safariland, text.rot=90, high.abun=low.abun, col.interaction="purple",
y.lim=c(0,4.5), high.lablength=0, arrow="up", method="normal",
y.width.high=0.05)
plotweb(t(Safariland), y.width.low=0.05, y.width.high=0.1, method="normal",
add=TRUE, low.y=1.7,high.y=2.7, col.low="green", text.low.col="black",
low.lab.dis=0, arrow="down", adj.low=c(0.5,1.1), low.lablength=4,
high.lablength=0)
plotweb(Safariland,y.width.low=0.05, y.width.high=0.1, method="normal",
add=TRUE, low.y=2.95, high.y=3.95, col.low="green", text.low.col="black",
low.lab.dis=0, arrow="down", adj.low=c(0.5,1.1), low.lablength=4)
# now some examples with the abuns.type-option:
plotweb(Safariland, abuns.type='independent',arrow="down.center")
plotweb(Safariland, abuns.type='additional',arrow="down.center")
# }
Run the code above in your browser using DataLab