[web2py] Re: Networkx draw graph

2014-04-14 Thread Massimo Di Pierro
matplotlib has two API. A stateless and a statefull. The statefull mode is called matplotlib.pyplot and is it designed for some compatibility with Matlab. Most of the examples posted are with pyplot. The problem is that pyplot does not work for multithreaded web apps because the state is in a

[web2py] Re: Networkx draw graph

2014-04-14 Thread Luis Fontes
Thank you very much Massimo. I will check if NetworkX can draw graphs without pyplot. Othercase I will have to draw my graphs from scratch using Figure, Axis, etc. On Monday, April 14, 2014 3:28:43 PM UTC+2, Massimo Di Pierro wrote: matplotlib has two API. A stateless and a statefull. The

[web2py] Re: Networkx draw graph

2014-04-13 Thread Massimo Di Pierro
Not sure but look into https://github.com/mdipierro/canvas On Saturday, 12 April 2014 04:10:42 UTC-5, Luis Fontes wrote: I am trying to plot a graph using NetworkX draw function but using cStringIO.StringIO(). I have read how to do it in web2py Application Development Cookbook. Let's say I

[web2py] Re: Networkx draw graph

2014-04-13 Thread Luis Fontes
On Saturday, April 12, 2014 11:10:42 AM UTC+2, Luis Fontes wrote: I am trying to plot a graph using NetworkX draw function but using cStringIO.StringIO(). I have read how to do it in web2py Application Development Cookbook. Let's say I have something like: import matplotlib.pyplot as

[web2py] Re: Networkx draw graph

2014-04-13 Thread Luis Fontes
Thank you very much for your help Massimo. The problem I have is not how to plot easily in matplotlib. My problem is how to display in my web2py view the NetworkX drawing made using nx.draw without saving the png file in disk but using some code like: canvas=FigureCanvas(fig)