graph_draw with fit_view = False
Hi,
I am currently using graph-tool 2.22-1 from the debian package provided for Ubuntu xenial: python3-graph-tool.
I have a relatively large graph which I would like to visualize in the "graph-tool interactive window", however it fails when I attempt to draw using fit_view=True. You can replicate this error with the following code, which fails for me:
from graph_tool.all import *
g=Graph()
v1=g.add_vertex();
v2=g.add_vertex();
g.add_edge(v1,v2)
graph_draw(g, fit_view=True)
Giving me the error:
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/graph_tool/draw/gtk_draw.py", line 515, in draw
> self.regenerate_surface()
> File "/usr/lib/python3/dist-packages/graph_tool/draw/gtk_draw.py", line 489, in regenerate_surface
> cr.set_matrix(self.tmatrix)
> SystemError: <built-in method set_matrix of cairo.Context object at 0x7fb09da18e30> returned NULL without setting an error
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/graph_tool/draw/gtk_draw.py", line 515, in draw
> self.regenerate_surface()
> File "/usr/lib/python3/dist-packages/graph_tool/draw/gtk_draw.py", line 489, in regenerate_surface
> cr.set_matrix(self.tmatrix)
> SystemError: <built-in method set_matrix of cairo.Context object at 0x7fb08b195cd0> returned NULL without setting an error
If fit_view=False, then it works fine, however my graph is over 100 nodes, and the layout gets messed up, and all nodes are cluttered to fit the window.