This is a test version of Biostars. For the public version, visit https://www.biostars.org.
rrvgo scatterPlot color palette

Hi all,

I am summarizing enrichGO results using the scatterPlot function from rrvgo package. I want to change the color palette but I am not able to do it. I was trying to change the function code but every time I change the scale_color_discrete it appears:

Error in grid.Call(C_convert, x, as.integer(whatfrom), as.integer(whatto), : Viewport has zero dimension(s)

FUNCTION: scatterPlot

function (simMatrix, reducedTerms, size = "score", addLabel = TRUE, labelSize = 3) { if (!all(sapply(c("ggplot2", "ggrepel"), requireNamespace, quietly = TRUE))) { stop("Packages ggplot2, ggrepel and/or its dependencies not available. ", "Consider installing them before using this function.", call. = FALSE) } x <- cmdscale(as.matrix(as.dist(1 - simMatrix)), eig = TRUE, k = 2) df <- cbind(as.data.frame(x$points), reducedTerms[match(rownames(x$points), reducedTerms$go), c("term", "parent", "parentTerm", "size")]) p <- ggplot2::ggplot(df, ggplot2::aes(x = V1, y = V2, color = parentTerm)) + ggplot2::geom_point(ggplot2::aes(size = size), alpha = 0.5) + ggplot2::scale_color_discrete(guide = "none") + ggplot2::scale_size_continuous(guide = "none", range = c(0, 25)) + ggplot2::scale_x_continuous(name = "") + ggplot2::scale_y_continuous(name = "") + ggplot2::theme_minimal() + ggplot2::theme(axis.text.x = ggplot2::element_blank(), axis.text.y = ggplot2::element_blank()) if (addLabel) { p + ggrepel::geom_label_repel(aes(label = parentTerm), data = subset(df, parent == rownames(df)), box.padding = grid::unit(1, "lines"), size = labelSize) } else { p } }

<bytecode: 0x557113250ef0>

<environment: namespace:rrvgo>

I tried to add + guides(fill="none") to solve this issue, but it's not working. Is there any way to fix this?

Thank you!

Ana

color rrvgo scatterplot

0 answers

No answers yet.

Log in to answer this question.