1

I'm trying to make a circular diagram using the 'circlize' package in R. I want to make a plot with three tracks, outer track with 36 sectors, middle track with 12 sectors, and inner track with 3 sectors. The sectors in each track should be of equal size.

This code creates the outer track correctly:

sectors = 1:36
circos.par(gap.degree = 0, cell.padding = c(0, 0, 0, 0),
           start.degree = 360/20/2, track.margin = c(0, 0), clock.wise = FALSE)
circos.initialize(sectors, xlim = c(0, 1))

circos.track(ylim = c(0, 1), sectors = sectors,
             bg.col = rep(c("lightblue", "lightgreen", 'lightyellow'), 12), bg.border = "black", track.height = 0.1)

circos.trackText(x = rep(0.5, 36), y = rep(0.5, 36),
                 labels = c('A', 'B', 'C') %>% rep(12),
                 cex = 0.8, sectors = sectors, col = "black", font = 2, facing = "downward")

existing plot

However, when I try to start the middle 12-sector track with circos.track(ylim = c(0, 1), sectors = 1:12, it just defaults to using 36 sectors. How can I fix this? Thanks for any assistance.

thelatemail
  • 91,185
  • 12
  • 128
  • 188
Matt Jago
  • 11
  • 1
  • You can use `circos.rect()` for this purpose. You can check the example [17.3 Ba-Gua and Tai-ji](https://jokergoo.github.io/circlize_book/book/make-fun-of-the-package.html#ba-gua-and-tai-ji). – Nitesh Shriwash Aug 03 '23 at 06:16

0 Answers0