graph_tool.draw.cairo_draw#
- graph_tool.draw.cairo_draw(g, pos, cr, vprops=None, eprops=None, vorder=None, eorder=None, nodesfirst=False, vcmap=None, ecmap=None, loop_angle=nan, parallel_distance=None, res=0, max_render_time=-1, **kwargs)[source]#
Draw a graph to a
cairocontext.- Parameters:
- g
Graph Graph to be drawn.
- pos
VertexPropertyMap Vector-valued vertex property map containing the x and y coordinates of the vertices.
- cr
Context A
Contextinstance.- vpropsdict (optional, default:
None) Dictionary with the vertex properties. Individual properties may also be given via the
vertex_<prop-name>parameters, where<prop-name>is the name of the property.- epropsdict (optional, default:
None) Dictionary with the edge properties. Individual properties may also be given via the
edge_<prop-name>parameters, where<prop-name>is the name of the property.- vorder
VertexPropertyMap(optional, default:None) If provided, defines the relative order in which the vertices are drawn.
- eorder
EdgePropertyMap(optional, default:None) If provided, defines the relative order in which the edges are drawn.
- nodesfirstbool (optional, default:
False) If
True, the vertices are drawn first, otherwise the edges are.- vcmap
matplotlib.colors.Colormapor tuple (optional, default:None) Vertex color map. Optionally, this may be a (
matplotlib.colors.Colormap, alpha) tuple.- ecmap
matplotlib.colors.Colormapor tuple (optional, default:None) Edge color map. Optionally, this may be a (
matplotlib.colors.Colormap, alpha) tuple.- loop_anglefloat or
EdgePropertyMap(optional, default:numpy.nan) Angle used to draw self-loops. If
nanis given, they will be placed radially from the center of the layout.- parallel_distancefloat (optional, default:
None) Distance used between parallel edges. If not provided, it will be determined automatically.
- bg_colorstr or sequence (optional, default:
None) Background color. The default is transparent.
- resfloat (optional, default:
0.): If shape sizes fall below this value, simplified drawing is used.
- max_render_timeint (optional, default:
-1): If nonnegative, this function will return an iterator that will perform part of the drawing at each step, so that each iteration takes at most
max_render_timemilliseconds.- vertex_*
VertexPropertyMapor arbitrary types (optional, default:None) Parameters following the pattern
vertex_<prop-name>specify the vertex property with name<prop-name>, as an alternative to thevpropsparameter.- edge_*
EdgePropertyMapor arbitrary types (optional, default:None) Parameters following the pattern
edge_<prop-name>specify the edge property with name<prop-name>, as an alternative to theepropsparameter.
- g
- Returns:
- iterator
If
max_render_timeis nonnegative, this will be an iterator that will perform part of the drawing at each step, so that each iteration takes at mostmax_render_timemilliseconds.