I have a plot and I would only like to render the legend but none of the plot points. Can anyone tell me how to do this?
library(tidyverse)
library(plotly)
mtcars %>%
mutate(cyl = factor(cyl)) %>%
plot_ly() %>%
add_markers(x = ~mpg,
y = ~hp,
color = ~cyl,
colors = c("4" = "red", "6" = "green", "8" = "blue"))
Currently I have this:
What I want is this: