define color scheme when plotting line plot with plotly
问题 I have the following data table (which is not always the same, and has always a different number of columns) and code for plotting a line chart: dt <- data.table(date = seq(as.Date('2020-01-01'), by = '1 day', length.out = 365), Germany = rnorm(365, 2, 1), Austria = rnorm(365, 3, 4), Czechia = rnorm(365, 2, 3), check.names = FALSE) colNames <- names(dt)[-1] ## assuming date is the first column p <- plotly::plot_ly() for(trace in colNames){ p <- p %>% plotly::add_trace(data = dt, x = ~date, y