问题
I have a data set df wich contains variables Name(factor), Count(integer) and Time(POSIXct).
I'm using the following code:
df %>% plot_ly(x=~Time,y = ~Count,group = ~Name,color=~Name,type='scatter',
mode='lines+markers')
What happen is that the lines don't appear at all (the markers appear perfecly tho). Changing mode to 'lines' makes the data invisible, but the information appear whenever I hover the pointer over data locations.
Also note that running without the groups produce the excpected result (with lines visible)
df %>% plot_ly(x=~Time,y = ~Count,type='scatter',
mode='lines+markers')
What is wrong? How to make the lines visible?
回答1:
Have you tried to ungroup the dataset? It worked for me.
df %>%
ungroup() %>%
plot_ly(x=~Time,y = ~Count,type='scatter', mode='lines+markers')
来源:https://stackoverflow.com/questions/46102483/r-plotly-invisible-lines