October 23, 2018

Types of Graphs

  • Scatter Graph
  • Scatter 3D Graph
  • Surface 3D Graph

Scatter Graph

data(mtcars)
plot_ly(mtcars, x = ~wt, y = ~mpg, type = "scatter", color = ~factor(cyl))

Scatter 3D Graph

x1 <- rnorm(120, mean =50 , sd = 5)
y1<- rnorm(120)
z1 <- 1:120
plot_ly(x = ~x1, y = ~y1, z = ~z1, type = "scatter3d", color = ~x1)

Surface 3D

Graph of z=x+4y

z1 <- matrix((1:100)+4*(1:100), nrow = 100, ncol = 100)
plot_ly(z=~z1, type = "surface")