Skip to content

Fork of networkx drawing utilities for publication quality plots of networks

License

Notifications You must be signed in to change notification settings

GillesD/netgraph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netgraph

Fork of networkx drawing utilities for publication quality plots of networks

Summary:

Module to plot weighted, directed graphs of medium size (10-100 nodes). Unweighted, undirected graphs will look perfectly fine, too, but this module might be overkill for such a use case.

Raison d'etre:

Existing draw routines for networks/graphs in python use fundamentally different length units for different plot elements. This makes it hard to - provide a consistent layout for different axis / figure dimensions, and - judge the relative sizes of elements a priori. This module amends these issues (while sacrificing speed).

Example:

import numpy as np
import matplotlib.pyplot as plt
import netgraph

# construct sparse, directed, weighted graph
# with positive and negative edges
n = 20
w = np.random.randn(n,n)
p = 0.2
c = np.random.rand(n,n) <= p
w[~c] = np.nan

# plot
netgraph.draw(w)
plt.show()

alt tag

About

Fork of networkx drawing utilities for publication quality plots of networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%