I published two functions to visualize trophic networks with three or n levels, although most of my work consists in dealing with two-mode (bipartite) networks. The R library bipartite provides two functions to visualize such webs (
visweb), and I am generally happy with the results of the latter. However, I sometimes find it difficult to use at it seems to require link intensity to be given as integers, and I never have this information. Even if it is easy to do something like
it is not really satisfactory.
There are also some other minor things with the bipartite package (namely, it requires the matrix to be entered « the wrong way », i.e. with the columns where one should expect to find the rows) and the graphical output of this particular function that make me uncomfortable using it.
I wrote a very short piece of R code that uses lines from the original function (to be exhaustive : the calculation of the margin size, and the sorting of the matrix to give it an ecological meaning), and obtained the following output quite easily:
I quite like the look of this, and I think that it is really easier to follow who interacts with who by just « sliding » along the grey lines.
You can get the R code here.