Question: How to generate a stripplot like this in Python or R?
2
gravatar for Ting-You Wang
12 months 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 • 530 views
ADD COMMENTlink modified 12 months ago by zx87549.1k • written 12 months 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 12 months ago by steve2.5k

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 12 months ago • written 12 months 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 12 months ago by cpad011212k
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 12 months ago by Ting-You Wang80

Related post: Plots in R for bioinformatics analyses

ADD REPLYlink written 12 months ago by zx87549.1k
1
gravatar for cpad0112
12 months ago by
cpad011212k
India
cpad011212k 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 12 months ago by cpad011212k
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: 1756 users visited in the last hour