python-igraph Manual

For using igraph from Python



igraph includes customization options that can be set via the configuration.Configuration object and can be preserved via a configuration file. This file is stored at ~/.igraphrc by default on Linux and Mac OS X systems, and at C:\Documents and Settings\username\.igraphrc on Windows systems.

To modify config options and store the result to file for future reuse:

import igraph as ig

# Set configuration variables
ig.config["plotting.backend"] = "matplotlib"
ig.config["plotting.palette"] = "rainbow"

# Save configuration to default file location

Once your configuration file exists, igraph will load its contents automatically upon import.

It is possible to keep multiple configuration files in nonstandard locations by passing an argument to, e.g."/path/to/config/file"). To load a specific config the next time you import igraph, use:

import igraph as ig