Skip to content

ivanov/grave

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grave

Build Status

GraVE is a Graph Visualization Package combining ideas from Matplotlib, NetworkX, and seaborn. Its goal is to provide a network drawing API that covers the most use cases with sensible defaults and simple style configuration. Currently, it supports drawing graphs from NetworkX.

graph

Example Usage

import network as nx
from networkx.algorithms.approximation.dominating_set import min_weighted_dominating_set

from grave import plot_network

network = nx.barbell_graph(10, 10)
dom_set = min_weighted_dominating_set(network)

for node, node_attrs in network.nodes(data=True):
    node_attrs['is_dominator'] = True if node in dom_set else False

def color_dominator_nodes(node_attrs):
    if node_attrs.get('is_dominator', False):
        return {'color': 'red'}
    else:
        return {'color': 'gray'}

fig, ax = plt.subplots()
plot_network(network, node_style=color_dominators)
plt.show()

About

GraVE: dead simple network (graph) drawing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%