23 jan 2017

Loading library and data

This presentation visualizes the iris dataset in three dimensions using the plotly library. Load these:

library(plotly)
data(iris)

Make the plot

X axis shows sepal length, y axis petal length, z axis petal width. Size show sepal width. Finally, color marks species:

plot <- plot_ly(iris,
        x = ~Sepal.Length, 
        y = ~Petal.Length,
        z = ~Petal.Width,
        size = ~Sepal.Width, type = "scatter3d",
        color = ~Species)

Show the plot

plot