散布図も
p <- ggplot(iris, aes(Sepal.Width, Sepal.Length))
p2 <- p + geom_point(aes(colour = Species))
p3 <- p2 + xlab("Sepal width") + ylab("Sepal length") +
xlim(2, 4.5) + ylim(4, 8)
print(p3)
old <- par(mar=c(3, 3, 1, 1), mgp=c(1.8, 0.6, 0), las=1)
plot(iris$Sepal.Width, iris$Sepal.Length, col=c(1, 2, 4)[as.integer(iris$Species)], pch=19, cex=0.7, xlab="Sepal width", ylab="Sepal length")
legend("topright", legend=c("setosa", "versicolor", "virginica"), col=c(1, 2, 4), pch=19, cex=0.8, bty="n")
par(old)
どっちがきれいか,明らかだと思うが