Seurat: Is there a way to set alpha for DimPlot?

Created on 8 Apr 2020  路  1Comment  路  Source: satijalab/seurat

Hi there does not seem to be an option for setting alpha for groups such as shape.by; I tried doing posthoc but it does not seem to work. For example.

tplot = DimPlot(main.integrated
, group.by = c("group" )
, combine = FALSE
, pt.size=1
, cols=c("#F8F8F8","red"))
tplot[[1]] +  scale_alpha_manual( values= c(.9,.001)) # this does nothing. 

using.
Seurat_3.1.4

Most helpful comment

found a solution and posting in case some else needs this.
tplot[[1]]$layers[[1]]$aes_params$alpha = .1
to get it to plot by group then every pt needs to have value so here is an example

tplot[[1]]$layers[[1]]$aes_params$alpha = ifelse ( [email protected]$samples == "exp", 1, .5 )

>All comments

found a solution and posting in case some else needs this.
tplot[[1]]$layers[[1]]$aes_params$alpha = .1
to get it to plot by group then every pt needs to have value so here is an example

tplot[[1]]$layers[[1]]$aes_params$alpha = ifelse ( [email protected]$samples == "exp", 1, .5 )

Was this page helpful?
0 / 5 - 0 ratings