No project description provided
Project description
Graphlot
Graphlot is a library that allows to simply visualize networks. It is built upon matplotlib, and plotly and exploits network layouts from networkx, igraph and graphviz.
For this reason the first step is to install graphviz by running
sudo apt install graphviz
Then we can install graphlot through pip
pip install graphlot
The library takes as input a networx graph and can plot the degree distribution and the network itself with different layouts.
To demonstrate it we will generate a random network with the function CreateNetworkFromRandomClasses(). This function takes as input a list and an integer. The list is of length n_classes and in which every value is the number of nodes of that specific classes. The integer is the number of random edges of the graph.
The function stores the information of the node belonging to a specific class in "Type" node attribute and node name in "name" node attribute.
import graphlot as gv
import random
random.seed(123127844)
grafo = gv.CreateNetworkFromRandomClasses([20,20,30], 150)
gv.plot_degree_distribution(grafo)
random.seed(123127844)
gv.visualize_network(grafo,mode = '2d',node_color_attribute='Type',legend = 'Type',cmap='viridis',node_annotation = 'Name')
Moreover graphlot allows to plot networks in 3d in order to have a more flexible visualization.
random.seed(123127844)
gv.visualize_network(grafo,mode = '3d',node_color_attribute='Type',legend = 'Type',cmap='viridis',node_annotation = 'Name')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file graphlot-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: graphlot-0.2.5-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e460050c5c00fdf315639c4218bba989b9d0ba3d2caef742ad7ddf396704c375 |
|
MD5 | 0da34c90b07cb1b741afaf5d7f066c12 |
|
BLAKE2b-256 | c4b8e0f0b0443aef1ff2e0604d0151c4a198520bd6c4a1b2fc3bea963b40691e |