Air Quality Dataset
library(ggplot2)
dat<-na.omit(airquality)
head(dat)
## Ozone Solar.R Wind Temp Month Day
## 1 41 190 7.4 67 5 1
## 2 36 118 8.0 72 5 2
## 3 12 149 12.6 74 5 3
## 4 18 313 11.5 62 5 4
## 7 23 299 8.6 65 5 7
## 8 19 99 13.8 59 5 8
3-dimenional scatter plot with (Ozone, Solar & Temp)
ggplot(dat, aes(x=Solar.R, y=Ozone, color=Temp )) +
geom_point(size=2, alpha=0.7) +
scale_colour_gradient(low="blue", high="yellow")

3-dimensional scatter plot with (Ozone, Solar & Month)
ggplot(dat,aes(x=Solar.R, y=Ozone, shape=as.factor(Month))) +
geom_point(size = 2, alpha = 0.7) +
scale_shape_discrete(labels = c("May", "Jun", "July", "Aug", "Sep"))

4-dimensional scatter plot with (Ozone, Solar, Temp & Month)
ggplot(dat, aes(x=Solar.R, y=Ozone, shape=as.factor(Month), color=Temp)) +
geom_point(alpha=0.7) +
scale_shape_discrete(labels = c("May", "Jun", "July", "Aug", "Sep")) +
scale_colour_gradient(low="blue",high="yellow") +
labs(shape="Month")
