how to produce plots like this in R
4
3
Entering edit mode
3.5 years ago

Dear all,

I am looking for the R package that I can use to produce this type of graphs:

I know ggplot2 has probably this capability but I can not find a proper tutorial to do it. I would be grateful if somebody can introduce a tutorial of how to produce these types of graphs.

Thanks

RNA-Seq • 9.0k views
0
Entering edit mode

That appears more as a bubble plot rather a dot plot. If you indeed need a dot plot, try this

0
Entering edit mode

@OP: it would help if you posted some example data.

4
Entering edit mode
3.5 years ago
jbalberge ▴ 170

Assuming you're analyzing single-cell RNA seq data, you can use the DotPlot function from Seurat:

DotPlot(object = pbmc, genes.plot = features.plot, plot.legend = TRUE)

0
Entering edit mode

Sorry, but here should I normalise for number of cells in each group? I mean when the bigger circle shows higher number of cells

3
Entering edit mode
3.5 years ago

Please refer to dotplot function in clusterprofiler package: Look at Visualization of profile comparison section in https://bioconductor.org/packages/devel/bioc/vignettes/clusterProfiler/inst/doc/clusterProfiler.html

screenshot from the webpage:

0
Entering edit mode

Thanks a lot. It is a very good suggestion but the problem is that I need something that I have full control on the graph production. I need to factor the data and compare different data sets in a same figure. That is why I asked for a ggplot2 tutorial.

2
Entering edit mode

oh okay. Then probably, geom_dotplot function in ggplot might help you in plotting.

1
Entering edit mode
3.5 years ago
EagleEye 7.2k

Try ggplot2 bubble chart

1
Entering edit mode
0
Entering edit mode
3.0 years ago
gaelgarcia05 ▴ 270

This is from the Seurat DotPlot function, which is documented here:

https://github.com/satijalab/seurat/blob/master/R/plotting.R

Essentially, it is a ggplot geom_point plot.