2

ここに画像の説明を入力してください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"))

色付きのシーケンス インデックス プロット 白黒出版用の調整されていないグレーのシーケンス インデックス プロット

4

1 に答える 1

1

コメントに続いて、グラフィックがまだ改善されていないこの「ソリューション」を思いつきました。残念ながら、凡例も上書きできなかったため、まだ作業が必要です。どなたかアイデア頂けたら嬉しいです!?

## Define smaller black/grey palette, delete almost white tones
greys <- c("black", "black", "black", "black", brewer.pal(5, "Greys")[2:5])

## Example plot using density and overwriting angle options
par(mar=c(1,2,1,1))
layout(matrix(c(1,2), 2, 1, byrow = TRUE), heights=c(2,1))
seqiplot(biofam.seq, withlegend=FALSE,
         cpal=greys,
         density=c(20, 20, 20, 20, -1, -1, -1, -1), 
         angle=c(45, 90, 45, 0, 0, 0, 0, 0))
seqiplot(biofam.seq, withlegend=FALSE,
         cpal=greys,
         density=c(20, 20, 20, 20, -1, -1, -1, -1), 
         angle=c(45, 90, 135, 0, 0, 0, 0, 0),
         add=TRUE)
         # Different angle for third state creates grid instead of patterns
seqlegend(biofam.seq, pos="center", ncol=3, fontsize=.7,
          cpal=greys,
          density=c(20, 20, 20, 20, -1, -1, -1, -1), 
          angle=c(45, 90, 45, 0, 0, 0, 0, 0))
seqlegend(biofam.seq, pos="center", ncol=3, fontsize=.7,
          cpal=greys,
          density=c(20, 20, 20, 20, -1, -1, -1, -1), 
          angle=c(45, 90, 135, 0, 0, 0, 0, 0))
          # Draws an additional legend instead of overwriting the first

ここに画像の説明を入力

于 2015-03-02T15:58:43.037 に答える