I'm using graphviz() to create a dot layout and GraphWindow() to create a widget in a window of said graph. When I view the graph all the vertices are overlapping and you can differentiate between them unless you zoom all the way in and use 'shift' to keep the vertices the same size and zoom back out. I've tried using fit_to_window, but every time I do it throws an AttributeError on line 568 of gtk_draw.py cr = self.get_window().cairo_create() AttributeError: 'NoneType' object has no attribute 'cairo_create' I create the window as self.win = GraphWindow(etc) so I pass the graph as self.win.graph.fit_to_window(ink=True, g=None) What exactly should I do to make the graph widget fit into the window without the vertices overlapping? -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 06/20/2014 08:01 PM, srichmo1 wrote:
I'm using graphviz() to create a dot layout and GraphWindow() to create a widget in a window of said graph. When I view the graph all the vertices are overlapping and you can differentiate between them unless you zoom all the way in and use 'shift' to keep the vertices the same size and zoom back out. I've tried using fit_to_window, but every time I do it throws an AttributeError on line 568 of gtk_draw.py cr = self.get_window().cairo_create() AttributeError: 'NoneType' object has no attribute 'cairo_create'
I create the window as self.win = GraphWindow(etc) so I pass the graph as self.win.graph.fit_to_window(ink=True, g=None)
What exactly should I do to make the graph widget fit into the window without the vertices overlapping?
I think the most direct approach would be to re-scale the sizes of the vertices prior to drawing. You can set arbitrary sizes with the vertex_size parameter (either to GraphWindow, graph_draw(), etc.) The fit_to_window() function would only take care of the positions, not the size of the vertices, so it probably will not solve your problem. But nevertheless I am curious to understand the error you are observing. Could you please send a short self-contained example where this error can be seen? Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
srichmo1 -
Tiago de Paula Peixoto