SSブログ

R: ggplot2: scale_manual その3 [統計]

scale_linetype_manual()scale_shape_manual()
Rplot004.png

コード

library(ggplot2)

n <- 10
m <- 8
x <- rep(seq(0, 1, len = n), m)
t <- rep(seq(1, m), each = n)
y <- t
d <- data.frame(x = x, y = y, t = as.factor(t))

p4 <- ggplot(d, aes(x = x, y = y, group = t)) +
      xlim(0, 1) +
      geom_line(aes(linetype = t, colour = t),
                size = 0.75, alpha = 1) +
      scale_linetype_manual(values = 1:m) +
      geom_point(aes(shape = t, colour = t),
                 size = 6, alpha = 1) +
      scale_shape_manual(values = 1:m)
png("Rplot004.png", width = 520, height = 480)
print(p4)     
dev.off()

タグ:R ggplot2
nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:パソコン・インターネット

nice! 0

コメント 0

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

Facebook コメント

トラックバック 0