January 21, 2018

Introduction

This is an R Markdown presentation that features plots created with Plotly. It consists of 4 plots:

  • 3D Plot with Parametric Equations
  • Surface Plot with Volcano Data
  • USA Airports
  • USA Flight Paths

Code for 3D Plot with Parametric Equations

library(plotly)
library(dplyr)
#parametric Equations
t = seq(0, 1, 0.001)
x = (1+0.25*cos(75*t))*cos(t)
y = (1+0.25*cos(75*t))*sin(t)
z = t +2.0*sin(75*t)
data <- data.frame(x = x,
                   y = y,
                   z = z)
p<-plot_ly(data, x = ~x, y = ~y, z = ~z,
           type = 'scatter3d', mode = 'lines', opacity = 1,
           line = list(width = 6, color = ~y, reverscale = FALSE))

3D Plot with Parametric Equations

Surface Plot with Volcano Data

x <- seq_len(nrow(volcano)) + 100
y <- seq_len(ncol(volcano)) + 500
plot_ly() %>% add_surface(x = ~x, y = ~y, z = ~volcano)

USA Airports

USA Flights Path