I am using networkx package to draw power law graphs. I want to simulate a search algorithm on this graph and want to visually see the algorithm move from one node to another on the graph. How do I do that?
On a mac you could use NodeBox: http://nodebox.net/.
NetworkX supports drawing using Graphviz and matplotlib. Did you read the drawing-chapter in its documentation?
Related
I have plotted a graph using matplotlib.pyplot. I need to integrate specific sections of this graph. All the tutorials I can find online are including drawing a graph from scratch, but what should I use if I already have a graph and just want to integrate a part of it?
Thank you!
In the networkx library is possible to click on a node and hi-light it and it’s edges.
This page illustrates this solution:
Interactive networkx. This is a desktop-based solution.
I tried to find a similar solution for the igraph library but I can't find it.
Currently, I use d3 and sigma.js for this purpose. But I'm interested in a desktop-based solution, similar to the above mentioned for the networkx library.
Does anyone know any desktop-based solution for interactively highlight nodes and edges using igraph library?
Thank you in advance.
I'm wondering if it is possible to plot a vertex as image (loaded from a file or directly) in Igraph. Any ideas?
This is definitley possible in the R version of iGraph using the raster function, however a brief search did not reveal any implementation of this function in Python (it's not in the igraph documentation anyway).
If this is essential to your work, then I would consider switching to R, or possibly another tool such as Gephi. For Python, however, you might consider using something like pyvis. This package is small but powerful in terms of visualization. I've been playing around with it over the past few days and its very easy to display a graph with pictures as nodes, and it comes with the added benefit of providing interactive functioning. Take a look at the tutorial here, which will highlight what this package can provide.
I am trying to generate a network graph for 200+ nodes and 300+ edges using networkx using python from a file. I was able to generate and plot the graph using matplotlib in my Juypter Notebook, but its not looking good and nodes are so tightly packed.
Is there any other python package help to generate network graph ??.
My aim is to generate graph for whole data set so that I can find dependency between nodes.
If nodes being too close together is the issue, try using the draw_spring()function of networkx.
https://networkx.github.io/documentation/networkx-2.0/reference/generated/networkx.drawing.nx_pylab.draw_spring.html#networkx.drawing.nx_pylab.draw_spring
It simulates what would happen if each edge were a spring and the network were picked up and spun around, seperating the nodes, especially the ones which are not connected via many paths.
If this does not work initially, you can use the parameters of the function that draw_spring() wraps, the spring_layout() function. Try adjusting the k value parameter. This should allow you to manipulate the rough distance between nodes.
https://networkx.github.io/documentation/networkx-2.0/reference/generated/networkx.drawing.layout.spring_layout.html#networkx.drawing.layout.spring_layout
Alternatively, there are additional draw functions you might find more useful than draw_spring(). You can find them in the draw section here: https://networkx.github.io/documentation/networkx-2.0/reference/drawing.html
I can recommend using Netwulf. Input a networkx.Graph object to netwulf.visualize, and launch the visualization in a new browser window. The result and data can be posted back to Python.
Disclaimer: I co-author Netwulf.
Suppose I have to create a graph with 15 nodes and certain nodes. Instead of feeding the nodes via coding, can the draw the nodes and links using mouse on a figure? Is there any way to do this interactively?
No.
Sorry. In principle it could be possible to create a GUI which interfaces with networkx (and maybe some people have), but it's not built directly into networkx.