@doc_params(scatter=doc_scatter)<EOL>def velocity_graph(adata, basis=None, vkey='<STR_LIT>', which_graph='<STR_LIT>', n_neighbors=<NUM_LIT:10>,<EOL>alpha=<NUM_LIT>, perc=<NUM_LIT>, edge_width=<NUM_LIT>, edge_color='<STR_LIT>', color=None, use_raw=None, layer=None,<EOL>color_map=None, colorbar=True, palette=None, size=None,  sort_order=True, groups=None,<EOL>components=None, projection='<STR_LIT>', legend_loc='<STR_LIT>', legend_fontsize=None, legend_fontweight=None,<EOL>right_margin=None, left_margin=None, xlabel=None, ylabel=None, title=None, fontsize=None,<EOL>figsize=None, dpi=None, frameon=None, show=True, save=None, ax=None):
basis = default_basis(adata) if basis is None else basis<EOL>title = which_graph + '<STR_LIT>' if title is None else title<EOL>scatter_kwargs = {"<STR_LIT>": basis, "<STR_LIT>": perc, "<STR_LIT>": use_raw, "<STR_LIT>": sort_order, "<STR_LIT>": alpha,<EOL>"<STR_LIT>": components, "<STR_LIT>": projection, "<STR_LIT>": legend_loc, "<STR_LIT>": groups,<EOL>"<STR_LIT>": legend_fontsize, "<STR_LIT>": legend_fontweight, "<STR_LIT>": palette,<EOL>"<STR_LIT>": color_map, "<STR_LIT>": frameon, "<STR_LIT:title>": title, "<STR_LIT>": xlabel, "<STR_LIT>": ylabel,<EOL>"<STR_LIT>": right_margin, "<STR_LIT>": left_margin, "<STR_LIT>": colorbar, "<STR_LIT>": dpi,<EOL>"<STR_LIT>": fontsize, "<STR_LIT>": False, "<STR_LIT>": None, "<STR_LIT>": figsize, }<EOL>ax = scatter(adata, layer=layer, color=color, size=size, ax=ax, zorder=<NUM_LIT:0>, **scatter_kwargs)<EOL>from networkx import Graph, draw_networkx_edges<EOL>if which_graph == '<STR_LIT>':<EOL><INDENT>T = adata.uns['<STR_LIT>']['<STR_LIT>']<EOL>if perc is not None:<EOL><INDENT>threshold = np.percentile(T.data, perc)<EOL>T.data[T.data < threshold] = <NUM_LIT:0><EOL>T.eliminate_zeros()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>T = transition_matrix(adata, vkey=vkey, weight_indirect_neighbors=<NUM_LIT:0>, n_neighbors=n_neighbors, perc=perc)<EOL><DEDENT>with warnings.catch_warnings():<EOL><INDENT>warnings.simplefilter("<STR_LIT:ignore>")<EOL>edges = draw_networkx_edges(Graph(T), adata.obsm['<STR_LIT>' + basis], width=edge_width, edge_color=edge_color, ax=ax)<EOL>edges.set_zorder(-<NUM_LIT:2>)<EOL>edges.set_rasterized(settings._vector_friendly)<EOL><DEDENT>savefig_or_show('<STR_LIT>' if basis is None else basis, dpi=dpi, save=save, show=show)<EOL>if not show: return ax<EOL>
\
    Plot of the velocity graph.

    Arguments
    ---------
    adata: :class:`~anndata.AnnData`
        Annotated data matrix.
    vkey: `str` or `None` (default: `None`)
        Key for annotations of observations/cells or variables/genes.
    which_graph: `'velocity'` or `'neighbors'` (default: `'velocity'`)
        Whether to show transitions from velocity graph or connectivities from neighbors graph.

    {scatter}

    Returns
    -------
        `matplotlib.Axis` if `show==False`