Edits to functions visweb
and plotweb
from the R package bipartite
Note the naming equivalence:
plot_grid
corresponds tobipartite::visweb
(Aug 19, 2015)plot_bipartite
corresponds tobipartite::plotweb
(Oct 6, 2014)
Original code for functions visweb
(plot_grid
) and plotweb
(plot_bipartite
) was taken from bipartite GitHub repository. I made a fork initially, but I realized soon than the repository is taking more space that I am willing to allocate.
All in all, I am only interested in editing the two functions mentioned above for personal use, so I started this separate repository.
This is work in progress!
library(bipartite)
# Source the functions from this repository
source("https://raw.githubusercontent.com/valentinitnelav/bipartite_webs/master/R/plot_bipartite.R")
source("https://raw.githubusercontent.com/valentinitnelav/bipartite_webs/master/R/plot_grid.R")
- disable
par
modifications during function call; - label adjustments:
- allow label size separately for lower and upper trophic levels;
- allow text rotation separately for lower and upper labels;
- allow adjustment of
pos
,offset
andfont
separately for lower and upper labels;
- disable
par
modifications during function call; - add
x.lim
&y.lim
arguments used for the same purpose as inplotweb
; - label adjustments:
- allow
side
,las
,font
andmgp
changes for axis labels; - add
mtext
for axis titles; - better replace
mtext
withtext
, which allows text rotation withsrt
; see this FAQ or this blog post; - use also
text
for axis labels instead of the currentaxis
(for the same reason as above); - re-arrange code (plot first matrix, then annotation) - this helps detecting if labels are under the matrix when testing edits;
- allow different sorting of the matrix to get the nestedness visual effect in any desired corner. This can be helpful when needing to rotate/further edit graphs in Inkscape.
- implement label/species coloring
- allow
The package bipartite is licensed under GPL (mentioned here) and this trickles down to this repository.