igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] how to plot graph on matplotlib figure?


From: Diederik van Liere
Subject: Re: [igraph] how to plot graph on matplotlib figure?
Date: Mon, 5 Jul 2010 11:27:19 -0400

Hi Tamas,

Just one final question about plotting a graph using matplotlib. It seems that the visual_style dictionary is not passed along to the renderer. Is this a limitation of using matplotlib or should the code snippet be extended with support for a visual_style dictionary?

Thanks so much!

best,
Diederik

On Mon, Jul 5, 2010 at 9:00 AM, Diederik van Liere <address@hidden> wrote:
Hi Tamas,

Indeed, renderer.gc.ctx does work, thanks so much for your help!!!!!

best,

Diederik


On Mon, Jul 5, 2010 at 8:44 AM, Tamas Nepusz <address@hidden> wrote:
Hi Diederik,

Hmmm, 'ctx' is an undocumented attribute of RendererCairo that should
hold the Cairo context on which matplotlib is drawing. It worked for me
with my version of Matplotlib (0.98.5.2), it looks like they have
changed something between Matplotlib 0.98.5.2 and 0.99.3. I'll try to
get hold of the most recent version and see what the new name of this
attribute is. Maybe try replacing 'renderer.ctx' with 'renderer.gc.ctx'
first, this seems to work in 0.99.1

--
Tamas

On Mon, Jul 05, 2010 at 08:41:11AM -0400, Diederik van Liere wrote:
> Hi Tamas,
>
> Thanks for your code snippet, however it does not work for me. I get a:
>
> RendererCairo instance has no attribute 'ctx'
> message, i am using igraph 0.5.3 and matplotlib 0.99.3 and cairo 1.8.10
>
> what should I do to fix this?
> best,
> Diederik
>
>
> On Wed, Jun 30, 2010 at 10:39 AM, Tamas Nepusz <address@hidden> wrote:
>
> > Hi Diederik,
> >
> > > I would like to add my graph to a matplotlib figure but don't know how.
> > I played around a bit with matplotlib today and this is what I came up
> > with (see the attachment). It works only for Cairo-based Matplotlib
> > backends as igraph supports plotting on Cairo contexts only.
> >
> > --
> > Tamas
> >
> > _______________________________________________
> > igraph-help mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/igraph-help
> >
> >

> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help


_______________________________________________
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]