library(plotly)

vst4<-read.csv("https://g...content-available-to-author-only...o.gl/t8yWII",header = T)

my_palette <- colorRampPalette(c("red","yellow","green"))(n = 64)

xa <- list(
    title = "里程數",
    autotick = FALSE,
    ticks = "outside",
    tick0 = 0,
    dtick = 5,
    ticklen = 5,
    tickwidth = 2,
    tickcolor = toRGB("black"),
    autorange = "reversed"
  )

ya <- list(
  title = "時間",
  autorange = "reversed",
  autotick = FALSE,
  autorange=T,
  dtick=60
)

plot_ly(x=vst4$milage,y=vst4$time_HM ,z = vst4$vdsAvgSpd, colors = my_palette , type = "heatmap")%>%
  layout(xaxis = xa,title="里程數")%>%
  layout(yaxis = ya,title="時間") %>%
  layout(title = "國五北上時空速率圖")
