I am trying to create an animated plotly line graph in R using my own data. The animation works when I used markers as the 'mode', however, when changing the mode to 'lines' or 'plines' nothing shows on the graph.
Any suggestions?
Data:
CH4
X FIRST SECOND
1 1 23.9 71.9
2 2 2.9 23.7
3 3 85.7 6.0
4 4 1.2 94.0
5 5 1.1 66.8
6 6 1.5 99.9
Code:
plot_ly(CH4, x=~X, y=~FIRST, name="FIRST",
hoverinfo = 'text',
text = ~paste('Test Round: ', CH4$X, '<br>',
'Concentration: ', CH4$SECOND),
type = "scatter", mode = "plines", frame=~frame) %>%
add_trace(x=~X, y = ~SECOND, name="SECOND", mode = 'plines') %>%
layout(yaxis = list(title = "CH4 Concentrations"), xaxis = list(title =
"Test Round"))