Home » Scatterplot

Scatterplot

 

#loading data

data(iris)

Scatterplot

plot(iris[,1], iris[,2], main = "Iris", 
     xlab = "Sepal Lenght",
     ylab = "Sepal Width",
     pch = 17,
     col = "red")

unnamed-chunk-21

plot(iris$Sepal.Length, iris$Sepal.Width, main = "Iris", 
     xlab = "Sepal Lenght",
     ylab = "Sepal Width",
     pch = 2,
     col = iris$Species, lwd=2)
abline(lsfit(iris[,1], iris[,2]), lwd=2, col = "red")

unnamed-chunk-22

plot(iris[,3], iris[,4], main = "Iris", 
     xlab = "Petal Lenght",
     ylab = "Petal Width",
     pch = c(iris$Species),
     col = iris$Species,
     lwd = 2)
abline(lsfit(iris[,3], iris[,4]), lwd=2, col = "red")

unnamed-chunk-23

 


Post a Comment