2017-10-21 17 views

答えて

0

6つの可能性のそれぞれについて、色、記号、ラベルを指定するだけです。

## Some bogus data 
set.seed(2017) 
x = runif(100) 
y = runif(100) 
COL = rep(1, 100) 
COL[x< 1/3] = 2 
COL[x> 2/3] = 3 
Symb = rep(15, 100) 
Symb[y<1/2] = 16 

## Plot and legend 
plot(x,y, pch=Symb, col=COL, xlim = c(0,1.15)) 
legend("topright", legend=LETTERS[1:6], col=1:3, pch=15:16) 

Plot with legend

関連する問題