Skip to main content

Convenience package for drawing NetworkX graphs

Project description

nxquickplot

Convenient plotting for graphs in NetworkX. These functions are rather asymmetric/non-composable because they aim to literally capture concrete use patterns rather than abstracting over them. If you need other stuff, just use the raw draw_networkx API.

API

Draw the graph with a force-directed layout

from nxquickplot import plot_force
import networkx

g = networkx.DiGraph()

g.add_node('Alice')
g.add_node('Bob')
g.add_edge('Alice', 'Bob')

plot_force(g)

Draw the graph with a random deterministic layout

from nxquickplot import plot_random_deterministic
import networkx

g = networkx.DiGraph()

g.add_node('Alice')
g.add_node('Bob')
g.add_edge('Alice', 'Bob')

plot_random_deterministic(g)

Draw the graph plotting a certain attribute rather than the node ID

from nxquickplot import plot_with_attr
import networkx

g = networkx.DiGraph()

g.add_node('Alice', age=42)
g.add_node('Bob', age=31)
g.add_edge('Alice', 'Bob')

plot_with_attr(g, 'age')

This must be force directed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nxquickplot, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size nxquickplot-1.0.0-py3-none-any.whl (6.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size nxquickplot-1.0.0.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page