Question: How to generate a stripplot like this in Python or R?
2
gravatar for Ting-You Wang
4 weeks ago by
Hong Kong/The University of Hong Kong
Ting-You Wang80 wrote:

How to generate a stripplot like this in Python or R?

enter image description here

Thank you so much in advance.

R rna-seq visualization python • 172 views
ADD COMMENTlink modified 16 days ago by zx87547.1k • written 4 weeks ago by Ting-You Wang80

in R you can just make a scatter plot in something like ggplot2. You could use facets per gene.

ADD REPLYlink written 4 weeks ago by steve1.9k

enter image description here

Another example is here. I don't think the author used facet to draw this. It seems that it used a special version of jitter (ordered).

ADD REPLYlink modified 4 weeks ago • written 4 weeks ago by Ting-You Wang80
  1. do a box plot and jitter.
  2. Do not draw box plot boundaries and let median line be there.
  3. Do facet (or equivalent with mfrow) per gene
ADD REPLYlink written 4 weeks ago by cpad011211k
1

usually, jitter in boxplot only generates some noise in x-axis to avoid overlapping. I don't know how to do it in an ordered manner. Can you show some code snippet? Thank you.

ADD REPLYlink written 4 weeks ago by Ting-You Wang80

Related post: Plots in R for bioinformatics analyses

ADD REPLYlink written 16 days ago by zx87547.1k
1
gravatar for cpad0112
28 days ago by
cpad011211k
India
cpad011211k wrote:

some thing like this ?

Rplot

codeL

library(dplyr)
library(tidyr)
df=data.frame(s1=rnorm(1000,0,10), s2=rnorm(1000,1,10), s3=rnorm(1000,2,10))
library(ggplot2)
df1=gather(df,"sample","value")

ggplot(df1, aes(x = sample, y = value)) +
  geom_point(aes(color=sample)) +
  stat_summary(
    fun.y = median,
    fun.ymin = median,
    fun.ymax = median,
    geom = "crossbar",
    color = "red",
    width=0.2,
    linetype = "dotted"
  )+
  ylim(-100,100)+
  theme_bw()+
  theme(legend.position="none")
ADD COMMENTlink written 28 days ago by cpad011211k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 934 users visited in the last hour