Skip to content

Instantly share code, notes, and snippets.

fig, ax = plt.subplots(figsize=(8, 8))
sc.pl.umap(ds, color="cell_type", legend_loc="on data", size=10, ax=ax, show=False)
shrink_by = 0.1
xlim = ax.get_xlim()
ylim = ax.get_ylim()
xbound = xlim[0] + (xlim[1] - xlim[0]) * shrink_by
ybound = ylim[0] + (ylim[1] - ylim[0]) * shrink_by
b = ax.spines["bottom"]