module documentation
Undocumented
Function | _write |
Saves the graph as an SVG (Scalable Vector Graphics) file |
def _write_graph_to_svg(graph, fname, layout='auto', width=None, height=None, labels='label', colors='color', shapes='shape', vertex_size=10, edge_colors='color', edge_stroke_widths='width', font_size=16, *args, **kwds):
(source)
¶
Saves the graph as an SVG (Scalable Vector Graphics) file
The file will be Inkscape (http://inkscape.org) compatible. In Inkscape, as nodes are rearranged, the edges auto-update.
Parameters | |
graph | Undocumented |
fname | the name of the file or a Python file handle |
layout | the layout of the graph. Can be either an explicitly specified layout (using a list of coordinate pairs) or the name of a layout algorithm (which should refer to a method in the Graph object, but without the layout_ prefix. |
width | the preferred width in pixels (default: 400) |
height | the preferred height in pixels (default: 400) |
labels | the vertex labels. Either it is the name of a vertex attribute to use, or a list explicitly specifying the labels. It can also be None. |
colors | the vertex colors. Either it is the name of a vertex attribute to use, or a list explicitly specifying the colors. A color can be anything acceptable in an SVG file. |
shapes | the vertex shapes. Either it is the name of a vertex attribute to use, or a list explicitly specifying the shapes as integers. Shape 0 means hidden (nothing is drawn), shape 1 is a circle, shape 2 is a rectangle and shape 3 is a rectangle that automatically sizes to the inner text. |
vertex | vertex size in pixels |
edge | the edge colors. Either it is the name of an edge attribute to use, or a list explicitly specifying the colors. A color can be anything acceptable in an SVG file. |
edge | the stroke widths of the edges. Either it is the name of an edge attribute to use, or a list explicitly specifying the stroke widths. The stroke width can be anything acceptable in an SVG file. |
font | font size. If it is a string, it is written into the SVG file as-is (so you can specify anything which is valid as the value of the font-size style). If it is a number, it is interpreted as pixel size and converted to the proper attribute value accordingly. |
*args | Undocumented |
**kwds | Undocumented |