chord-diagram

R circlize: Error in circos.initialize

爷,独闯天下 提交于 2019-12-12 10:30:03
问题 I am able to follow the Circlize example in the description of the package on CRAN easily: library('circlize') set.seed(123) mat = matrix(sample(1:100, 18, replace = TRUE), 3, 6) rownames(mat) = letters[1:3] colnames(mat) = LETTERS[1:6] ### basic settings par(mfrow = c(3, 2)) par(mar = c(1, 1, 1, 1)) chordDiagram(mat) however, when I replace mat with myMatrix I get this error: Error in circos.initialize(factors = factor(cate, levels = cate), xlim = cbind(rep(0, : Since `xlim` is a matrix, it

Visualizing the pass traffic data with Chord Diagram

試著忘記壹切 提交于 2019-12-09 07:44:28
I have a pass traffic data between players, here's the data , first column and first row indicate the Player Numbers. I want to visualize this data like Uber Rides . I think it was built with Chord Diagram from Bostock's. Since I almost have no experience in JavaScript, I just don't know where to begin. How can I achieve something like this? Here is what i got with your data I just replaced the matrix array with your array [2,3,1,0,0,2,0,6,5,2,5,0,3], [0,7,2,0,4,7,0,1,2,0,3,0,2], [0,0,4,1,5,3,3,0,1,1,5,1,0], [0,0,0,0,4,0,5,4,2,0,1,1,0], [0,0,0,0,0,0,0,3,2,0,1,0,1], [0,0,0,0,0,1,3,4,1,1,9,1,6],

D3.js Chord diagram - Have text appear/disappear when hovering over an arc

佐手、 提交于 2019-12-08 08:32:47
问题 I'm trying to add a small function to the Chord Diagram created by Mike Bostock. When I hover over a certain arc, say Group A, I want a piece of text that I've placed to the right of the chord diagram to update its text to explain some insights that are particular to Group A. When the user moves his/her mouse away from the arc/chord (so all the chords become visible again), I want the text to go back to what it said before (which in my case is a short explanation of how to understand a Chord

Adjust highlight.sector() width and placement - Chord diagram (circlize package) in R

耗尽温柔 提交于 2019-12-08 03:00:28
问题 I need some help with adjusting highlighted sectors of a chordDiagram() from the circlize package. I am working with fisheries landings data. Fishing vessels start their trip in one port (homeport PORT_DE ), and land their catch in another port (landing port PORT_LA ). I am working with scallops live weight in tonnes (landings SCALLOP_W ). Here is a simple example of the dataframe: PORT_DE PORT_LA SCALLOP_W 1 Aberdeen Aberdeen 116 2 Barrow Barrow 98 3 Douglas Barrow 127 4 Kirkcudbright Barrow

Chord Diagram in Python? [closed]

a 夏天 提交于 2019-12-03 11:00:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is there a python library which has chord diagram module? I know there exists one in D3.js, but would like to know if something exists for python. An example of a chord diagram: 来源: https://stackoverflow.com/questions/19105801/chord-diagram-in-python

Not sure why dcast() this data set results in dropping variables

这一生的挚爱 提交于 2019-12-02 12:11:31
问题 I have a data frame that looks like: id fromuserid touserid from_country to_country length 1 1 54525953 47195889 US US 2 2 2 54525953 54361607 US US 1 3 3 54525953 53571081 US US 2 4 4 41943048 55379244 US US 1 5 5 47185938 53140304 US PR 1 6 6 47185938 54121387 US US 1 7 7 54525974 50928645 GB GB 1 8 8 54525974 53495302 GB GB 1 9 9 51380247 45214216 SG SG 2 10 10 51380247 43972484 SG US 2 Each row describes a number of messages (length) sent from one user to another user. What I would like

Rotate labels in a chordDiagram (R circlize)

江枫思渺然 提交于 2019-11-30 12:41:30
Here is some code from the circlize package for creating a chord diagram.Right now the labels are parallel to the edge of the circle. Is it possible to rotate the labels 90 degrees to they are perpendicular to the circle? library(circlize) set.seed(999) mat = matrix(sample(18, 18), 3, 6) rownames(mat) = paste0("Start", 1:3) colnames(mat) = paste0("End", 1:6) chordDiagrm(mat) In the figure below I manually inserted a few labels to show what I hope to accomplish (End5, End6, End7). Thanks. Based on your example data, here's one way to do it: grid.col <- setNames(rainbow(length(unlist(dimnames

Rotate labels in a chordDiagram (R circlize)

限于喜欢 提交于 2019-11-29 18:57:59
问题 Here is some code from the circlize package for creating a chord diagram.Right now the labels are parallel to the edge of the circle. Is it possible to rotate the labels 90 degrees to they are perpendicular to the circle? library(circlize) set.seed(999) mat = matrix(sample(18, 18), 3, 6) rownames(mat) = paste0("Start", 1:3) colnames(mat) = paste0("End", 1:6) chordDiagrm(mat) In the figure below I manually inserted a few labels to show what I hope to accomplish (End5, End6, End7). Thanks. 回答1:

R make circle/chord diagram with circlize from dataframe

我只是一个虾纸丫 提交于 2019-11-28 17:40:27
I would like to make a chord diagram using the circlize package . I have a dataframe containing cars with four columns. The 2 first columns contains information on car band and model owned and the next two columns to the brand and model the respondent migrated to. Here is a simple example of the dataframe: Brand_from model_from Brand_to Model_to 1: VOLVO s80 BMW 5series 2: BMW 3series BMW 3series 3: VOLVO s60 VOLVO s60 4: VOLVO s60 VOLVO s80 5: BMW 3series AUDI s4 6: AUDI a4 BMW 3series 7: AUDI a5 AUDI a5 It would be great to be able to make this into a chord diagram. I found an example in the

Chord diagram in R [closed]

孤人 提交于 2019-11-28 03:20:29
Is there any package in cran which could plot a chord layout like this: (this visualization is also called chord diagram ) I wrote the following several years ago, but never really used it: feel free to adapt it to your needs, or even turn it into a full-fledged package. # Return a line in the Poincare disk, i.e., # a circle arc, perpendicular to the unit circle, through two given points. poincare_segment <- function(u1, u2, v1, v2) { # Check that the points are sufficiently different if( abs(u1-v1) < 1e-6 && abs(u2-v2) < 1e-6 ) return( list(x=c(u1,v1), y=c(u2,v2)) ) # Check that we are in the