Putting cells in Seurat dimplot selectively I am going to adjust Seurat dimplot in a way avoiding some cells so both my dimplot and heatmap look nice

If you please consider this picture, you would see some cells are far from the clusters so I want to avoid them in dimplot and of course for heatmap (coming from finding markers).

[![enter image description here][1]][1]

Can you suggest me a piece of code doing that?
Thanks
If you're using a GUI you could select the cells interactively:

plot &lt;- DimPlot(seurat_obj, reduction = "umap")


Then select the cells by clicking around them

select.cells &lt;- CellSelector(plot = plot)
Idents(seurat_obj, cells = select.cells) &lt;- "SubCells"


and subset based on these cells

sub_cells &lt;- WhichCells(seurat_obj, idents = "SubCells")
sub_obj &lt;- subset(seurat_obj, cells = sub_cells)


You could then use subobject in your downstream dimplot.

See here for some of the interactive options. I guess you could outright subset on UMAP coordinates, but that may not always be easy if your boundary isn't linear.