igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Better layout output in igraph


From: Tamas Nepusz
Subject: Re: [igraph] Better layout output in igraph
Date: Mon, 08 Aug 2011 10:37:34 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

> with for example
> plot_ca = cairo.PSSurface("/home/havard/ca.ps",300,300)
> fig = igraph.Plot(target=plot_ca)
> fig.add(i, layout="grid_fruchterman_reingold",
> vertex_label=None,vertex_size=0.007, edge_width=0.005,bbox=(180, 180))
> 
> the output is often restricted to a small area in the bottom corner of
> the ps/pdf document.
Actually, I tried your example and it put the graph in the top left corner
of the PS file, so I'm not sure what is going on here.

> I have tried with bbox=None, but with some "cairo surfaces" it fails
> with a error like "x = 4, y= -300000". (note cairo.PDFSurface does not
> seem to work with igraph at all)
I regularly create PDF plots with igraph as follows (g is my graph)

igraph.plot(g, "output.pdf", bbox=(600, 600), layout="kamada_kawai",
vertex_label=...)

Theoretically igraph.plot does roughly the same things as you do above
manually (it infers the Cairo surface type from the extension), and I've
never had problems with it. Which Cairo version are you using and does the
version of the Cairo library match the version numbe of the Python interface
of Cairo on your system?

> Any tips on how to produce better graph-layout printouts with igraph?
I usually just use the plot function as above. Even if I use the Plot class
(because I need a more complicated plot), I don't create the surface
manually, I just pass the filename to the "target" argument of Plot and it
creates an appropriate surface.

> And can igraph create curved edges like gephi?
The Python interface does not support this in 0.5.4 yet. The R interface
supports an edge attribute named "curved" which lets you control the
curvature of the edge. The Python interface in 0.6 will support custom edge
drawer classes, so you would be able to plug in your own edge drawer there.

Cheers,
Tamas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]