jokergoo / circlize

Circular visualization in R
http://jokergoo.github.io/circlize_book/book/
Other
959 stars 141 forks source link

Sector colors #353

Open syuxuan opened 1 year ago

syuxuan commented 1 year ago

Hi,

I am trying to plot a circular heatmap with 5 categories ( 5 sectors). Is there a way to assign different colors to different sectors while still having color gradients? The plot maybe looks like this image Thanks!

jokergoo commented 1 year ago

You can set bg.col as a vector.

circos.initialize(sectors = letters[1:8], xlim = c(0, 1))

circos.track(ylim = c(0, 1), bg.col = rand_color(8), panel.fun = function(x, y) {
    circos.points(runif(10), runif(10))
})
image