Change colors in graph and legend #57
-
Hello, The package is wonderful and I am grateful you created this, but is there a parameter in the function term_gene_graph() to change the color of the up-regulated and down-regulated genes? It is red and green at the moment, but some people are Red-Green colorblind so I want to change it to a different color. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hey @yolpanhchana, thank you, glad you enjoy the package. The object produced by Hope this helps, library(pathfindR)
library(ggplot2)
g <- term_gene_graph(RA_output)
g <- g + scale_color_manual(values = c("gray60", "blue", "green"), # manually selected colors
name = NULL, # to remove legend title
labels = c("enriched term", # legend keys
"up-regulated gene",
"down-regulated gene"))
g |
Beta Was this translation helpful? Give feedback.
-
@egeulgen Oh awesome! Thank you so much XD Have a wonderful day! |
Beta Was this translation helpful? Give feedback.
hey @yolpanhchana,
thank you, glad you enjoy the package. The object produced by
term_gene_graph()
is a ggplot object so you can treat it as such and modify the plot. Below you may find an example manipulation to change the colors of the vertices. Simply replace "gray60", "blue" and "green" with the desired colors.Hope this helps,
Best,
-E