Skip to content
Patricia Wollstadt edited this page Jul 18, 2018 · 1 revision

IDTxl provides simple plotting routines to visualise networks and their adjacency matrices. For advanced plotting of networks, see the export routines.

Import IO functions and load example data

import pickle
from idtxl.visualise_graph import plot_network, plot_selected_vars
import matplotlib.pyplot as plt

results = pickle.load(open('test/data/mute_results_0.p', 'rb'))

Plot inferred network graph

graph, fig = plot_network(results, 'max_te_lag', fdr=False)
plt.show()

Plot graph of selected source variables

graph, fig = plot_selected_vars(
            results, target=1, sign_sources=True, fdr=False)
plt.show()

By setting sign_sources to True only significant sources are included, otherwise all sources in the cadidate set are plotted:

graph, fig = plot_selected_vars(
            results, target=1, sign_sources=False, fdr=False)
plt.show()
Clone this wiki locally