I am using the code below to make two population on my umap
adata_all.obs["cell_type_lvl0"] = adata_all.X[:, adata_all.var["marker"] == 'CD45RA'] > 0.5
adata_all.obs["cell_type_lvl0"] = adata_all.obs["cell_type_lvl0"].map(
{True: "CD45+", False: "CD45-"}
)
import matplotlib.pyplot as plt
import scanpy.plotting as sc_pl
# create a new figure with a specified size
fig = plt.figure(figsize=(8, 8))
# plot UMAP with color
sc_pl.umap(adata_all, color='cell_type_lvl0', ax=True)
# set axis labels and tick labels
plt.xlabel('UMAP 1', fontsize=12)
plt.ylabel('UMAP 2', fontsize=12)
plt.xticks(fontsize=10)
plt.yticks(fontsize=10)
# show the figure
plt.show()
he code on top shows me an empty umap. but, The line sc_pl.umap(adata_all, color='cell_type_lvl0') shows me umap but without numeric x and y axis. how can I fix this? The code on top shows me an empty umap
Please try the following: