R: Adjusting Labels in circlize diagram

前端 未结 2 1094
傲寒
傲寒 2021-01-16 19:39

I have the code below which im trying to make into a circular diagram using the amazing package circlize

I have read the vigenette and admit some of it has gone over

相关标签:
2条回答
  • 2021-01-16 19:57

    I actually had the same problem that the "old" labels were still there when I wanted the rotate labels. The trick for me was to use

    chordDiagram(as.matrix(data).....etc.

    so when I explicitly said I had a matrix it worked.

    0 讨论(0)
  • 2021-01-16 20:01

    I was wondering if there is a quick way to remove all the labels on my diagram including tick marks and just add back in AUDI, VOLVO and BMW in light grey at the same angle to the sector as per this example

    You might try

    chordDiagram(df[1:2], col = col[df$Customer.Sat], diffHeight = diffHeight[df$Customer.Sat], annotationTrack = "grid", preAllocateTracks = 1)
    circos.trackPlotRegion(track.index = 1, panel.fun = function(x, y) {
      xlim = get.cell.meta.data("xlim")
      ylim = get.cell.meta.data("ylim")
      sector.name = get.cell.meta.data("sector.index")
      circos.text(mean(xlim), ylim[1] + .1, sector.name, facing = "clockwise", niceFacing = TRUE, adj = c(0, 0.5), col = "lightgray")
    }, bg.border = NA)
    

    which gives you

    0 讨论(0)
提交回复
热议问题