3

我正在使用DescTools RPlotCirc()包的功能来可视化列联表:

library(DescTools)

tab <- matrix(c(2,5,8,3,10,12,5,7,15), nrow=3, byrow=FALSE)
dimnames(tab) <- list(c("ABCDEFG","BCDEFGH","CDEFGHI"), c("D","E","F"))

PlotCirc( tab,
          acol = c("dodgerblue","seagreen2","limegreen","olivedrab2","goldenrod2","tomato2"),
          rcol = SetAlpha(c("red","orange","olivedrab1"), 0.5)
)

在此处输入图像描述

问题:

如何旋转所有标签(左侧和右侧)以使它们从圆圈(指向圆圈中间的文本基线)散开?即第一个标签“ABCDEFG”应该向上旋转几乎-90 度,而“CDEFGHI”应该旋转大约45 度指向下方等等。

4

2 回答 2

2

我不知道如何在那个包中做到这一点。但是,仍然可以:

tab <- matrix(c(2,5,8,3,10,12,5,7,15), nrow=3, byrow=FALSE)
dimnames(tab) <- list(c("A","B","C"), c("D","E","F"))



PlotCirc( tab,labels = NA, cex.lab = 1.0,acol = c("dodgerblue","seagreen2","limegreen","olivedrab2","goldenrod2","tomato2"),rcol =   SetAlpha(c("red","orange","olivedrab1")))



text(3,15,"ABCDEFG",srt=80)
text(11,10,"BCDEFG",srt=40)
text(13,-5,"CDEFG",srt=-30)
text(-5,-12,"DEFG",srt=60)
text(-12,-5,"EFG",srt=30)
text(-9,11,"FG",srt=-45)

http://i.stack.imgur.com/sK6Kr.png

于 2014-08-31T14:48:43.053 回答
1

DescTools v0.99.8现在提供了一个函数参数las,它完全可以完成工作(感谢作者 Andri Signorell)。

于 2014-09-21T06:21:03.333 回答