Skip to content

Change colors in graph and legend #57

Answered by egeulgen
yolpanhchana asked this question in Q&A
Discussion options

You must be logged in to vote

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

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"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by egeulgen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #57 on December 09, 2020 04:04.