interactive and 3 d scatterplot

8
Interactive and 3D Scatterplot in R Mr. S. B. Adnaik (Ph.D., Statistics)

Upload: sachin-adnaik

Post on 09-Jan-2017

53 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive and 3D Scatterplot in R

Page 2: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive plots

# Create some linked plots library(iplots)attach(iris) ihist(Sepal.Length) # histogram ibar(Species) # barchartiplot(Sepal.Length, Sepal.Width) # scatter plotibox(iris[,1:4]) # boxplots

Note: Click on any graph and see how they are related to each other.

Page 3: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive plots...

Page 4: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive plots...

# Interacting with a scatterplot attach(iris)plot(Sepal.Length, Sepal.Width) # scatterplotidentify(Sepal.Length, Sepal.Width, labels=row.names(iris)) # identify points

Note: Click on points toGet its location (row no.)Click ‘stop’ to exit.

Page 5: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Scatterplot 3D

# 3D Scatterplotlibrary(scatterplot3d)attach(iris)scatterplot3d(iris[,1:3], main="3D Scatterplot")

Page 6: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Scatterplot 3D...

# 3D Scatterplot with Coloring and Vertical Drop Lineslibrary(scatterplot3d) attach(iris) scatterplot3d(iris[,1:3], pch=16, highlight.3d=TRUE, type="h", main="3D Scatterplot")

Page 7: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Scatterplot 3D...

# 3D Scatterplot with Coloring and Vertical Lines and Regression Plane library(scatterplot3d) attach(iris) s3d <-scatterplot3d(iris[,1:3], pch=16, highlight.3d=TRUE, type="h", main="3D Scatterplot")fit <- lm(Sepal.Width~Petal.Length+Petal.Width) s3d$plane3d(fit)

Page 8: Interactive and 3 d scatterplot

Mr. S. B. Adnaik (Ph.D., Statistics)

Thanks