Plot Food Web

Functions for ecological modelling


Updated Fri, 06 Dec 2019 10:29:42 +0000

From GitHub

View License on GitHub

PLOTFOODWEB makes it easy to produce beautiful 3D or 2D figures of ecological food webs. The only required argument is the adjacency matrix of predator-prey connections. Sizes, colors, trophic levels, and the spatial arrangement can be specified as optional arguments. The submission figure shows three possibilities. In the top-left is the default type. The top-right is high-quality with random arrangement and the size of spheres as a function of the Log of body mass. At the bottom, a biplot where species are arranged according to mass (X-axis) and trophic level (Y-axis).

Cite As

Francisco de Castro (2023). Plot Food Web (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Patchline

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

Connect to Github

Corrected detail in the help.

new figure

Add a new type of plot. Reorganize help

Use default color map if Brewer color function is not installed.
Forgot to include the file in previous update
Change 'mds' option in 'arrange' for 'pca' (principal components analysis).
Added option to color by kmeans clustering of adjacency matrix.
Correct brewer colormap problem
Correct minor typos in help
Added required function 'calcarc'

Ability to specify variable line colors.
Possibility to use curved lines
Ability to provide a full interactions matrix, not just adjacency matrix of 0 and 1.

Option to plot in 2D
Option to arrange species by multidimensional scaling
Faster plotting
Optional transparency of lines
Option to plot the food web in 2D.
Option to arrange species in 3D with mutidimensional scaling
Faster plotting of cylinders connecting species
Optional transparency of lines
Rearranged and improved help
Added missing function fwrotation

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.