From 678f20d5709607b1e4915d2be2dd20ff258b96fc Mon Sep 17 00:00:00 2001 From: Holger Brandl Date: Fri, 28 Jul 2017 16:32:25 +0200 Subject: [PATCH] updated core_commons version. --- R/ggplot_commons.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R/ggplot_commons.R b/R/ggplot_commons.R index 4b18a6e..df6439f 100644 --- a/R/ggplot_commons.R +++ b/R/ggplot_commons.R @@ -140,7 +140,7 @@ makePcaPlot = function(matrixData, color_by=NA, items=rownames(matrixData), titl pc12 <- data.frame(PCA1 = scores[, 1], PCA2 = scores[, 2], group = color_by_sorted) if(is.na(color_by)){ - pcaPlot = ggplot(pc12, aes(PCA1, PCA2, text= paste("Sample:", items))) + geom_point(alpha = .4) + pcaPlot = ggplot(pc12, aes(PCA1, PCA2, text= paste("Sample:", items))) + geom_point(alpha = .75) }else{ pcaPlot = ggplot(pc12, aes(PCA1, PCA2, color = group, text=paste("Sample:", items))) + geom_point(alpha = .4) } @@ -225,7 +225,7 @@ gp_bin2d <- function(data, mapping, ..., low = "#10721C", high = "#F11D05") { ######################################################################################################################## ### Base-plot utils - +# https://stackoverflow.com/questions/15282580/how-to-generate-a-number-of-most-distinctive-colors-in-r plotPDF <- function(fileBaseName, expr, ...){ pdf(paste0(fileBaseName, ".pdf"), ...); expr; dev.off(); } #plotPDF("test", plot(1:10)) @@ -242,4 +242,3 @@ create_palette <- function(x, pal = 'Set1'){ setNames(brewer.pal(name = pal, n = n)[1:n], ux) } - -- GitLab