# Umap shapes different for the same dataset

**URL:** <https://discourse.scverse.org/t/umap-shapes-different-for-the-same-dataset/2004>\
**Category:** scanpy\
**Created:** [January 15, 2024, 9:41am UTC](https://discourse.scverse.org/t/umap-shapes-different-for-the-same-dataset/2004 "2024-01-15T09:41:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![malonzm1](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@malonzm1](https://discourse.scverse.org/u/malonzm1)\
**Post date:** [January 15, 2024, 9:41am UTC](https://discourse.scverse.org/t/umap-shapes-different-for-the-same-dataset/2004/1 "2024-01-15T09:41:36Z")

</div>

Hi,

I generated two umaps using the same dataset but with one I first plotted background cells (in gray) before the cells of interest. The shapes of the two umaps are different.

The code for the regular umap:

```auto
sc.pp.highly_variable_genes(
    adata0,
    n_top_genes=2000,
    subset=True,
    layer="counts",
    flavor="seurat_v3",
)
sc.tl.pca(adata0)
sc.pp.neighbors(adata0, n_pcs=30, n_neighbors=20)
sc.tl.umap(adata0, min_dist=0.3)
sc.pl.umap(
    adata0,
    color=["gse"],
    frameon=False,
)

```

The code for the umap first plotting background cells before the cells of interest:

```auto
sc.pp.highly_variable_genes(
    adata0,
    n_top_genes=2000,
    subset=True,
    layer="counts",
    flavor="seurat_v3",
)
sc.tl.pca(adata0)
sc.pp.neighbors(adata0, n_pcs=30, n_neighbors=20)
sc.tl.umap(adata0, min_dist=0.3)
adata = adata0[adata0.obs.clone != 'None']
ax=sc.pl.umap(adata0, show=False, frameon=False, size=5)
adata = adata0[adata0.obs.clone != 'None']
sc.pl.umap(
    adata,
    color=["clone"],
    frameon=False,
    size=5,
    ax = ax,
)

```

The resulting umap for regular umap:

 ![umap_10x_gse](https://canada1.discourse-cdn.com/flex035/uploads/forum11/original/1X/c468795824ccaaf20618df337093f8757e47e5a5.png)

The resulting umap when background cells first plotted:  
 ![umap_10x_mixcr_2](https://canada1.discourse-cdn.com/flex035/uploads/forum11/original/1X/810f154f6e7a6f77de61cbca1f4624c852e427fe.png)

As you can see the two umaps have different shapes. Any ideas? Thanks.

---

<div class="post-metadata">

**Author:** ![malonzm1](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@malonzm1](https://discourse.scverse.org/u/malonzm1)\
**Post date:** [January 15, 2024, 9:48am UTC](https://discourse.scverse.org/t/umap-shapes-different-for-the-same-dataset/2004/2 "2024-01-15T09:48:53Z")

</div>

I just realized the shapes are the same (accounting for bigger dot size).
