我正在尝试使用r库"circlize" 复制此网站的图表https://gjabel.wordpress.com/2014/03/28/circular-migration-flow-plots-in-r/.不幸的是我有两个问题:
首先,我收到了所有绘图区域的警告(即Note: 1 point is out of plotting region in sector 'Mexico', track '1').我认为问题是,在circos.text和circos.axis,因为我是用他们一起direction,这是一个过时的功能.但也使用facing而不是direction,问题仍然存在.所以我想我不理解这个警告的含义.你有一些提示可以帮助我吗?
而且,在我的情节中,链接距离细分很远.因此,我试图减少track.margin,它解决了这个问题,但现在这些段的名称都在边缘之外,我无法将它们可视化.有没有更好的方法来解决这个问题?
这是我到目前为止所写的内容(几乎完全取自本网站https://github.com/null2/globalmigration)
library("circlize")
library("plyr")
library("migest")
#load data
m<-read.table(system.file("science", "country_custom.txt", package = "migest"), skip=2, stringsAsFactors=FALSE)
#1)a data.frame to store information on each segment of the circle to be plotted
df1<-m[,1:3]
names(df1)<-c("order","rgb","region")
df1$region<-gsub("\\.", "\n", df1$region)
#2) a matrix containing the flow data (in this example only 28 countries)
m<-m[,-(1:3)]/1e05
m<-as.matrix(m)
dimnames(m)<-list(orig=df1$region,dest=df1$region) …Run Code Online (Sandbox Code Playgroud)