I need to create a GUI for graph construction ("graph" as an abstract representation of a set of objects, not a visual representation of data). The interface will provide a choice of ~5 vertex types and of ~5 edge types. Each vertex will have two data fields: a text label and a file name, which need to be easily editable.
I'm familiar with igraph and have a lot of code written in it. I will use igraph to manipulate the graphs created with this GUI.
Since this will be my first GUI, I'm completely ignorant of what tools are available. Can you please suggest a free library, knowing that eventually the program will need to work on Windows?
EDIT
it seems from the answers I get that I wasn't clear enough. I'm not looking for a way to visualize a graph, but rather for a way to visually create one. By visually, I mean not needing to manually create text files or writing code.
Take a look at xdot.py.
From the homepage
xdot.py is an interactive viewer for graphs written in Graphviz's
dot language.
It uses internally the graphviz's xdot output format as an
intermediate format, and PyGTK and Cairo for rendering.
xdot.py can be used either as a standalone application from
command line, or as a library embedded in your python application.
I like networkx,
from networkx import draw, Graph
from pylab import show
g = Graph()
g.add_edges_from([(1,2),(1,3),(2,4),(2,5)])
draw(g)
show()
which gives,
The only quirk is the requirement for matplotlib to get builtin plotting to work.
If you use python, I think PyQt is a good selection.
What you have to install is listed below:
install Python from here
install PyQt4 from here
But it takes many lines to write GUI application,
it is sometimes better to generate an image to display with image viewer.
Related
I need to deploy my python code as an .exe-file, which should generate quite a lot of 3d surface plots. Because of the deployment, I cannot use any library which relies on either Numpy, Pandas, Matplotlib etc, because this will cause huge filesizes of the .exe.
Unfortunately, plotly and bokeh only work well in the browser, i.e. generate interactive plots. To make a jpg/png from there, I'd need to also embed selenium browser into my exe for bokeh which is not really what I'm looking for.
That's why I'm wondering whether you know a "lean" (i.e.: small) library to generate surface plots? Apart from that, most of these heavy customization-possibilities are not needed at all, simply a good style and that's it.
Any ideas?
Thanks!
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 looking to replace a MATLAB GUI used to do manual scoring of objects within a tif file. Someone recommended Bokeh to me. Is it possible to read a tif-file using any module and allow interactivity via Bokeh?
I have not used Bokeh (but I have kept an eye on it), so my answer is: Yes, you could probably use Bokeh for this.
But considering that you are replacing a MATLAB GUI, I think there might be an easier way. Bokeh creates plots that run in your web browser, which might not be what you want.
Instead, you could look into using matplotlib to do it.
The PyPlot API in matplotlib is very similar to the plot functions in MATLAB, and it supports creating interactive plots.
To read the TIFF file I would recommend looking into either PIL or OpenCV.
I am trying to draw a dynamic graph which I want to control ( moving edges or nodes, update data of edges or nodes, click on edge to show more information...).
I have tried several programs and packages like prefuse, networkx and also processing.
But with these, we cannot control edges (onClick listener for exemple) we can just control nodes.
I have also a little problem because I am using python to parse the data and binding languages is a new thing for me , I have tried Jython with processing which was really slow...
I will appreciated any help of you
Thank you!
Take a look at this example
http://developer.qt.nokia.com/doc/qt-4.8/graphicsview-elasticnodes.html
You should be able to make the same using Python Binding for C++/Qt aka PyQt or Pyside. It should run and render much faster.
I would like to make graph like this in Python:
I have made the program in C that will give me combinations I need (here N=2n+|m| iirc), so could I integrate that here somehow?
I made something in Mathematica, but that's a pain in the butt... Any help is appreciated.
I would customize CairoPlot for doing that (http://linil.wordpress.com/2008/09/16/cairoplot-11/ ) --
Cairoplot is a simple and small project to use the powerfull Cairo library to make Graph's.
It does have few, although beauutiful, graphic options, but it is entirely made in Python - it should be possible to subclass a graph class from there to generate plots that fit your need.
You could try using step() in matplotlib
http://matplotlib.sourceforge.net/examples/pylab_examples/step_demo.html