Color coding Sectors #344
Replies: 3 comments
-
Can you tell me how you use the function? Maybe you can paste your full set of code here. |
Beta Was this translation helpful? Give feedback.
-
This is the df2 data frame and the corresponding values which I tried making a color ramp with and used the code as following library(circlize) Or use a data framedf = read.table("Chord_GO_KEGG.txt",sep='\t', header = TRUE) grid.col = colorRamp2(range(df2["size"]), c("#004bff", "#bfd2ff"), transparency = 0.1) col_fun = colorRamp2(range(df["value"]), c("#FFEEEE", "#FF0000"), transparency = 0.1) #chordDiagram(df, grid.col = grid.col, col = col_fun) png("Chord_Diagram_GO_KEGG.png", units = "in", width = 15.5, height = 16.5, res=1200) chordDiagram(df, grid.col = grid.col, col = col_fun, annotationTrack = c("grid"), annotationTrackHeight = mm_h(10), link.border="white", link.zindex = rank(df["value"]), link.sort = TRUE, link.decreasing = TRUE) dev.off() circos.clear() If I need to post other files, please let me know. And thank you again for trying to help me |
Beta Was this translation helpful? Give feedback.
-
chordDiagram(df, grid.col = grid.col, ... Argument grid.col = colorRamp2(range(df2["size"]), c("#004bff", "#bfd2ff"), transparency = 0.1)(df2["size"])
names(grid.col) = df2[, 1]. ## now grid.col is a named vector
chordDiagram(df, grid.col = grid.col, ... |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thank you for a wonderful package for visualization and making it public for everyone's use.
I have come across an error that I am looking for some help on.
I tried using ColorRamp2 to give a range of colors to sectors but it gives the following error:
Error in rep(grid.col, n) :
attempt to replicate an object of type 'closure'
Pardon me for my beginner-level knowledge in R.
Beta Was this translation helpful? Give feedback.
All reactions