jokergoo / circlize

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

Offsetting block/chromosome labelling #336

Open mrmrwinter opened 2 years ago

mrmrwinter commented 2 years ago

Hi @jokergoo,

Great software!

Is there a way to increase the distance between chromosome labels and the track? In the example below, i would like to make it so that the chromosome numbers dont overlap with the axes labels. I cant see a setting for this in circos.genomicInitialize()

Thanks!

image

jokergoo commented 2 years ago

In circos.genomicInitialize():

circos.genomicInitialize(..., plotType = "axis")

then you go to the first track and add chromosome names there:

circos.track(track.index = 1, panel.fun = function(x, y) {
    circos.text(CELL_META$xcenter, some_value_here, CELL_META$sector.index, ...)
})

Here you can adjust the value of some_value_here (e.g. 1.1) to control the position of chromosome names in the plot.

mrmrwinter commented 2 years ago

Excellent, thanks @jokergoo