enrichplot icon indicating copy to clipboard operation
enrichplot copied to clipboard

Recolouring treeplot

Open danphillips28 opened this issue 11 months ago • 1 comments

Hi! Really nice package, thank you! I am trying to modify the colouring for treeplot. I was able to modify the code for gseaplot2 pretty easily by changing the function code, but doing this for treeplot returned:

function (x, ...) 
standardGeneric("treeplot")
... etc

I then tried simply tagging on ggcode to the plotting call, which worked to change the cluster block colours (via fill), and the dot point colours using colour, but this still leaves the dendogram and labels the previous and unwanted colours;

gsetreeplot <- treeplot(gsetree, hclust_method = "complete") + 
    scale_fill_manual(values = c("#006600",
                                 "#300000",
                                 "#ff9900",
                                 "red",
                                 "#1d3e59")) +
     scale_colour_gradient(low = "#000000",
                           high = "#ffffff",
                           guide = "p Value")

image

How can I change these aesthetics? And moreover, how would I go about further modifying the appearance of this plot (line widths, dot borders, etc), like I was able to do by modifying the gseaplot2 function code?

Thanks again, Dan

danphillips28 avatar Jul 30 '23 13:07 danphillips28

You can use the group_color parameter to change to colour:

group_color | A vector of group colors, the length of the vector should be the same as nCluster. Will be removed in the next version.

huerqiang avatar Aug 04 '23 04:08 huerqiang