igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] 3d plot


From: Tamas Nepusz
Subject: Re: [igraph] 3d plot
Date: Fri, 19 Jun 2009 16:40:02 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hi,

> i'm playing with the plot method and i don't understand what's the
> meaning of the 3d layout algorithms (like fr3d and kk3d). Can i plot
> on a PNG?
No, you can't, the plotting methods expect a 2D layout. I wrote a 3D
graph visualiser some time ago in Python using igraph and OpenGL and
these methods were handy to calculate a nice layout, but otherwise
they're quite useless without an external visualisation engine. However,
since the functions are there in the core C library and it cost me
nothing to implement the interface in Python, I did it.

If you are interested, I can try and dig up the code for that old 3D
visualiser of mine and send it to you. It's more like pure eye candy as
it cannot really cope with larger graphs (i.e., more than a couple of
hundred vertices), but you can rotate the graphs around or put it in
auto-rotating mode.

-- 
Tamas


Or can i play with them (e.g. rotate) in a "3d window". If i
> try to plot i get:
> 
> In [28]: ig.plot(g, layout='kk3d')
> ---------------------------------------------------------------------------
> ValueError                                Traceback (most recent call last)
> 
> /nfsmnt/sra0/sra/setti/<ipython console>
> 
> /hardmnt/neyo0/sra/setti/usr/lib64/python2.4/site-packages/igraph/drawing.pyc
> in plot(obj, target, bbox, *args, **kwds)
>     739     cw, ch = bbox.width/60., bbox.height/60.
>     740     result.add(obj, bbox.contract((cw, ch, cw, ch)), *args, **kwds)
> --> 741     if target is None: result.show()
>     742     if isinstance(target, basestring): result.save()
>     743     return result
> 
> /hardmnt/neyo0/sra/setti/usr/lib64/python2.4/site-packages/igraph/drawing.pyc
> in show(self)
>     396             sur=self._surface
>     397             ctx=self._ctx
> --> 398             if self._is_dirty: self.redraw(ctx)
>     399
>     400         self._create_tmpfile()
> 
> /hardmnt/neyo0/sra/setti/usr/lib64/python2.4/site-packages/igraph/drawing.pyc
> in redraw(self, context)
>     344                 if opacity < 1.0: ctx.push_group()
>     345                 else: ctx.save()
> --> 346                 plotter(ctx, bbox, palette, *args, **kwds)
>     347                 if opacity < 1.0:
>     348                     ctx.pop_group_to_source()
> 
> /hardmnt/neyo0/sra/setti/usr/lib64/python2.4/site-packages/igraph/__init__.pyc
> in __plot__(self, context, bbox, palette, *args, **kwds)
>    1747             layout = Layout(layout)
>    1748
> -> 1749         sl, st, sr, sb = layout.bounding_box()
>    1750         sw, sh = sr-sl, sb-st
>    1751         if sw == 0 and sh == 0: sw, sh = 1, 1
> 
> ValueError: too many values to unpack
> 
> 
> I think igraph is using a 3d bbox (6 dim), so it can't unpack the
> array on 4 variables.
> 
> Thanks
> -- 
> 
> Davide Setti
> blog: http://blog.flatlandia.eu
> home: http://www.flatlandia.eu
> 
> 
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help




reply via email to

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