voyagerpy.plotting.draw_graph#

voyagerpy.plotting.draw_graph(adata: AnnData, graph_key: str | None = None, ax: Axes | None = None, width: float = 0.4, subset: Sequence[str] | None = None, geom: str | None = None, **kwargs)#

Draw a networkx graph on an axes.

This function plots the edges of the graph.

Parameters:
  • adata (AnnData) – The annotated data matrix.

  • graph_key (str, optional) – The name of the graph to draw. Must exist in …, by default None.

  • ax (Optional[Axes], optional) – The axes to use for plotting. If None, a new Axes object will be created, by default None.

  • width (float, optional) – The width of the edges, by default 0.4.

  • subset (Optional[Sequence[str]], optional) – A subset of points to draw, by default None.

  • geom (Optional[str], optional) – The geometry to use for the node positions, by default None.

Returns:

The axes used for plotting.

Return type:

Axes

Raises:

ImportError – If networkx is not installed.

Note

This function requires networkx to be installed.

Note

This function currently only supports visium graphs. Support for other graphs will be added in the future. In the meantime, you can use networkx directly to plot other graphs.