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 <[email protected]>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ graph-tool mailing list [email protected] http://lists.skewed.de/mailman/listinfo/graph-tool
