在此处输入图像描述在发布序列分析或通常具有许多分类状态的图时,常见问题1 2是它们不容易转移到黑白纸质出版物。有一些工具,例如Colorbrewer,可以帮助对灰度颜色做出明智的决定。尽管如此,如果调色板超过 5 种或更多的灰色阴影,结果将不能令人满意。因此,在这些情况下,将图案填充添加到某些图形区域会非常有帮助(尽管著名的 Edward Tufte 不推荐这样做)。
是否可以使用 R 基础图形的图案填充功能或基础图形的扩展来向图形添加填充图案TraMineR
?
这是序列索引图的小示例:
library(TraMineR)
library(RColorBrewer)
## Load example dataset with 8 sequence states
data(biofam)
## Define sequence objects
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.seq <- seqdef(biofam, 10:25, labels=biofam.lab)
## Example plot in colors
seqiplot(biofam.seq, cex.legend=.7)
## Example plot in greys for b/w publication
seqiplot(biofam.seq, cex.legend=.7, cpal=brewer.pal(8, "Greys"))