sample_data <-
data.frame
(x =
c
(
rnorm
(50),
rnorm
(50, 5),
rnorm
(50, 10)),
y =
c
(
rnorm
(50),
rnorm
(50, 5),
rnorm
(50, 10)),
group =
c
(
rep
(1, 50),
rep
(2, 50),
rep
(3, 50)))
par
(mar =
c
(10, 3, 3, 3), xpd =
TRUE
)
plot
(sample_data$x, sample_data$y,
pch = sample_data$group+10,
col = sample_data$group)
legend
(
"topright"
, inset =
c
(0.4, 1.2),
legend =
c
(
"Group 1"
,
"Group 2"
,
"Group 3"
),
pch =
c
(11,12,13), col = 1:3)