1

In the migration example dataset with code provided at [https://www.data-to-viz.com/graph/chord.html], why in some objects, axis line does not extends beyond max values. For example, in South East Asia, Europe and West Asia, axis line is not complete, while some has complete axis line. chord diag

It appears like, axis line are covered through max value of objects where links begin, however, axis lines are either complete or partial where links end or connect other objects.

In another example axis line is mostly incomplete. chord diag

Is there a parameter in circlize to have complete axis lines where links meet objects? or is there a way to curtail axis line before links meet objects?

gnuser23
  • 11
  • 2
  • Hi gnuser23, welcome to StackOverflow! It sounds like you have two separate questions in there: – Mark Jul 12 '23 at 04:33
  • 1. "why in some objects, axis line does not extends beyond max values" – Mark Jul 12 '23 at 04:34
  • 2. (and 3 I guess) Is there a parameter in circlize to have complete axis lines where links meet objects? or is there a way to curtail axis line before links meet objects? – Mark Jul 12 '23 at 04:34
  • @Mark, Yes, there are two questions but they are related. One is why axis line go missing? and the second is how to address it? As far the question about axis line beyond max value, it not a question per se, but rather a statement. Max values of an object connecting other objects through links are covered where links begin. Missing axis lines occur when links from an object connect certain objects. I have edited the statement. – gnuser23 Jul 12 '23 at 14:11

1 Answers1

0

You can manipulate the axis line using circos.axis() function when creating a chord diagram. I checked the code of the attached chord diagram for the migration example dataset, the problem is in the majar.at argument of the circos.axis() part.

The seq(from = 0, to = xlim[2], by = ifelse(test = xlim[2]>10, yes = 2, no = 1)) command generates one number less when the value of xlim[2] is above 10 and is odd.

like here:

xlim=get.cell.meta.dat("xlim")
xlim[2] = 11
seq(from=0, to=xlim[2], by = ifelse(test = xlim[2]>10, yes = 2, no = 1))
#[1]  0  2  4  6  8 10

You can see here that the seq() function generated digits from 0-10 instead of 0-11. This is the reason why the axis lines are smaller than they should be. You can modify this part and get your results. I would suggest you to use by = 1 in seq() function. This will generate all the points from 0 to 11.

seq(from=0, to=11, by=1 )
#[1]  0  1  2  3  4  5  6  7  8  9 10 11
Nitesh Shriwash
  • 128
  • 1
  • 6