easygraph.functions.drawing.utils module#

easygraph.functions.drawing.utils.apply_alpha(colors, alpha, elem_list, cmap=None, vmin=None, vmax=None)[source]#

Apply an alpha (or list of alphas) to the colors provided.

Parameters:
  • colors (color string or array of floats (default='r')) – Color of element. Can be a single color format string, or a sequence of colors with the same length as nodelist. If numeric values are specified they will be mapped to colors using the cmap and vmin,vmax parameters. See matplotlib.scatter for more details.

  • alpha (float or array of floats) – Alpha values for elements. This can be a single alpha value, in which case it will be applied to all the elements of color. Otherwise, if it is an array, the elements of alpha will be applied to the colors in order (cycling through alpha multiple times if necessary).

  • elem_list (array of networkx objects) – The list of elements which are being colored. These could be nodes, edges or labels.

  • cmap (matplotlib colormap) – Color map for use if colors is a list of floats corresponding to points on a color mapping.

  • vmin (float) – Minimum and maximum values for normalizing colors if a colormap is used

  • vmax (float) – Minimum and maximum values for normalizing colors if a colormap is used

Returns:

rgba_colors – Array containing RGBA format values for each of the node colours.

Return type:

numpy ndarray

easygraph.functions.drawing.utils.draw_circle_edge(ax: Axes, v_coor: List[Tuple[float, float]], v_size: list, e_list: List[Tuple[int, int]], e_color: list, e_fill_color: list, e_line_width: list)[source]#
easygraph.functions.drawing.utils.draw_line_edge(ax: Axes, v_coor: array, v_size: list, e_list: List[Tuple[int, int]], show_arrow: bool, e_color: list, e_line_width: list)[source]#
easygraph.functions.drawing.utils.draw_vertex(ax: Axes, v_coor: List[Tuple[float, float]], v_label: List[str] | None, font_size: int, font_family: str, v_size: list, v_color: list, edgecolors, v_line_width: list)[source]#
easygraph.functions.drawing.utils.edge_list_to_incidence_matrix(num_v: int, e_list: List[tuple]) ndarray[source]#
easygraph.functions.drawing.utils.hull_layout(n_v, e_list, pos, v_size, radius_increment=0.3)[source]#
easygraph.functions.drawing.utils.init_pos(num_v: int, center: Tuple[float, float] = (0, 0), scale: float = 1.0)[source]#
easygraph.functions.drawing.utils.safe_div(a: ndarray, b: ndarray, jitter_scale: float = 1e-06)[source]#