File:Jitterbox.png

From 太極
Jump to navigation Jump to search

Original file(1,020 × 906 pixels, file size: 50 KB, MIME type: image/png)

Summary

nc <- 5
assy <- LETTERS[1:nc]
pal <- ggpubr::get_palette("default", nc)

set.seed(1)
nr <- 5
mat <- matrix(runif(nr*length(assy)), nrow = nr, ncol = length(assy))
set.seed(1)
cutoffs <- runif(nc)
colnames(mat) <- assy
par(mar=c(5,4,1,1)+.1)
plot(1, 1, xlim = c(0.5, nc + .5), 
     ylim = c(0,1), type = "n", xlab = "Assay", 
     ylab = "Score", xaxt = 'n')
for (i in 1:nc) {
  rect(i - 0.25, 0, i + 0.25, 1, col = pal[i])
  lines(x = c(i - 0.25, i + 0.25), y = c(cutoffs[i], cutoffs[i]), 
        col = "black", lwd = 2)
  points(jitter(rep(i,  nr), amount=.2), mat[, i], pch=16)
}
axis(1, at = 1:ncol(mat), labels = colnames(mat))

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:53, 8 February 2024Thumbnail for version as of 22:53, 8 February 20241,020 × 906 (50 KB)Brb (talk | contribs)<syntaxhighlight lang='r'> nc <- 5 assy <- LETTERS[1:nc] pal <- ggpubr::get_palette("default", nc) set.seed(1) nr <- 5 mat <- matrix(runif(nr*length(assy)), nrow = nr, ncol = length(assy)) set.seed(1) cutoffs <- runif(nc) colnames(mat) <- assy par(mar=c(5,4,1,1)+.1) plot(1, 1, xlim = c(0.5, nc + .5), ylim = c(0,1), type = "n", xlab = "Assay", ylab = "Score", xaxt = 'n') for (i in 1:nc) { rect(i - 0.25, 0, i + 0.25, 1, col = pal[i]) lines(x = c(i - 0.25, i + 0.25), y = c(cutof...

The following page uses this file: